Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/mac_HS16/cmake/CopyLibPhase.cmake @ 11285

Last change on this file since 11285 was 11285, checked in by ahedges, 7 years ago

add clang-format config and document CopyLibPhase

File size: 2.3 KB
Line 
1#
2#             ORXONOX - the hottest 3D action shooter ever to exist
3#                             > www.orxonox.net <
4#
5#        This program is free software; you can redistribute it and/or
6#         modify it under the terms of the GNU General Public License
7#        as published by the Free Software Foundation; either version 2
8#            of the License, or (at your option) any later version.
9#
10#       This program is distributed in the hope that it will be useful,
11#        but WITHOUT ANY WARRANTY; without even the implied warranty of
12#        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#                 GNU General Public License for more details.
14#
15#   You should have received a copy of the GNU General Public License along
16#      with this program; if not, write to the Free Software Foundation,
17#     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18#
19#
20#  Author:
21#    Alexander Hedges
22#  Description:
23#    Copies the libs into to all the app bundles of the target destinations.
24#
25
26# Specify dependency locations
27SET(DEP_INCLUDE_DIR   ${DEPENDENCY_PACKAGE_DIR}/include)
28SET(DEP_LIBRARY_DIR   ${DEPENDENCY_PACKAGE_DIR}/lib)
29SET(DEP_BINARY_DIR    ${DEPENDENCY_PACKAGE_DIR}/bin)
30SET(DEP_FRAMEWORK_DIR ${DEPENDENCY_PACKAGE_DIR}/Library/Frameworks)
31
32# Copy libs to all app folders
33foreach(target IN ITEMS ${CMAKE_CONFIGURATION_TYPES})
34    file(GLOB_RECURSE dep_frameworks FOLLOW_SYMLINKS "${DEP_FRAMEWORK_DIR}/*")
35    file(GLOB_RECURSE dep_libraries FOLLOW_SYMLINKS "${DEP_LIBRARY_DIR}/*")
36
37    foreach(p IN LISTS dep_frameworks)
38        STRING(REGEX REPLACE "${DEP_FRAMEWORK_DIR}" "" rel_p ${p})
39        configure_file(${p}
40        "${CMAKE_BINARY_DIR}/bin/${target}/Orxonox.app/Contents/Frameworks/${rel_p}" COPYONLY)
41    endforeach()
42
43    foreach(p IN LISTS dep_libraries)
44        STRING(REGEX REPLACE "${DEP_LIBRARY_DIR}" "" rel_p ${p})
45        configure_file(${p}
46        "${CMAKE_BINARY_DIR}/bin/${target}/Orxonox.app/Contents/Frameworks/${rel_p}" COPYONLY)
47    endforeach()
48
49    file(GLOB_RECURSE dep_plugins FOLLOW_SYMLINKS "${DEP_BINARY_DIR}/*")
50
51    foreach(p IN LISTS dep_plugins)
52        STRING(REGEX REPLACE "${DEP_BINARY_DIR}" "" rel_p ${p})
53        configure_file(${p}
54        "${CMAKE_BINARY_DIR}/bin/${target}/Orxonox.app/Contents/Plugins/${rel_p}" COPYONLY)
55    endforeach()
56endforeach()
Note: See TracBrowser for help on using the repository browser.