forked from ivansafrin/Polycode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
101 lines (78 loc) · 3.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT(Polycode)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
MESSAGE("No CMAKE_BUILD_TYPE specified, defaulting to ${CMAKE_BUILD_TYPE}")
ENDIF(NOT CMAKE_BUILD_TYPE)
#IF(APPLE OR WIN32)
# SET(build_player OFF)
#ELSE()
# SET(build_player OFF)
#ENDIF()
IF(NUMBER_IS_SINGLE)
add_definitions(-DPOLYCODE_NUMBER_IS_SINGLE)
MESSAGE("USING SINGLE PRECISION NUMBERS")
ENDIF()
# Options for what components to build
#OPTION(POLYCODE_BUILD_SHARED "Build Polycode shared libraries" OFF)
#OPTION(POLYCODE_BUILD_STATIC "Build Polycode static libraries" ON)
OPTION(POLYCODE_BUILD_BINDINGS "Build Polycode Lua bindings" OFF)
OPTION(POLYCODE_BUILD_MODULES "Build Polycode modules" ON)
OPTION(POLYCODE_BUILD_PLAYER "Build Polycode standalone player" OFF)
OPTION(POLYCODE_BUILD_TOOLS "Build Polycode tools" ON)
OPTION(POLYCODE_BUILD_DOCS "Build Polycode documentation" ON)
OPTION(POLYCODE_INSTALL_FRAMEWORK "Install Polycode Core, Modules and Tools" ON)
OPTION(POLYCODE_INSTALL_PLAYER "Install Polycode Player" ${POLYCODE_BUILD_PLAYER})
OPTION(POLYCODE_INSTALL_TEMPLATE "Install Template project" ON)
OPTION(POLYCODE_INSTALL_DOCS ${POLYCODE_BUILD_DOCS})
# Some non-standard CMake modules
SET(CMAKE_MODULE_PATH ${Polycode_SOURCE_DIR}/CMake)
IF(NOT POLYCODE_RELEASE_DIR)
SET(POLYCODE_RELEASE_DIR ${Polycode_SOURCE_DIR}/Release/${CMAKE_SYSTEM_NAME})
MESSAGE("No POLYCODE_RELEASE_DIR specified, to ${POLYCODE_RELEASE_DIR}")
ENDIF(NOT POLYCODE_RELEASE_DIR)
SET(CMAKE_INSTALL_PREFIX ${POLYCODE_RELEASE_DIR}/Framework/)
# set default externals install location
SET(CMAKE_PREFIX_PATH
${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies
${POLYCODE_RELEASE_DIR}/Framework/Modules/Dependencies
${POLYCODE_RELEASE_DIR}/Framework/Tools/Dependencies)
# Process subdirectories
ADD_SUBDIRECTORY("Core/Contents")
ADD_SUBDIRECTORY("Assets")
ADD_SUBDIRECTORY("Documentation")
IF(POLYCODE_BUILD_BINDINGS)
ADD_SUBDIRECTORY(Documentation/Lua/scripts)
ADD_SUBDIRECTORY(Bindings)
ENDIF(POLYCODE_BUILD_BINDINGS)
IF(POLYCODE_BUILD_MODULES)
ADD_SUBDIRECTORY(Modules/Contents)
IF(POLYCODE_BUILD_BINDINGS)
ADD_SUBDIRECTORY(Modules/Bindings)
ENDIF(POLYCODE_BUILD_BINDINGS)
ENDIF(POLYCODE_BUILD_MODULES)
IF(POLYCODE_BUILD_PLAYER)
ADD_SUBDIRECTORY(Player/Contents)
ENDIF(POLYCODE_BUILD_PLAYER)
IF(POLYCODE_BUILD_TOOLS)
ADD_SUBDIRECTORY(Tools/Contents)
ENDIF(POLYCODE_BUILD_TOOLS)
INSTALL(FILES LICENSE.txt
DESTINATION ./)
INSTALL(DIRECTORY ${Polycode_SOURCE_DIR}/Examples/C++/Build/${CMAKE_SYSTEM_NAME} DESTINATION Examples)
INSTALL(DIRECTORY ${Polycode_SOURCE_DIR}/Examples/C++/Contents DESTINATION Examples/${CMAKE_SYSTEM_NAME})
INSTALL(DIRECTORY ${Polycode_SOURCE_DIR}/Examples/C++/Resources DESTINATION Examples/${CMAKE_SYSTEM_NAME})
INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies DESTINATION Core)
INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Modules/Dependencies DESTINATION Modules)
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "8")
SET(CPACK_PACKAGE_VERSION_PATCH "2")
IF(WIN32)
SET(CPACK_GENERATOR "ZIP")
ELSE(WIN32)
SET(CPACK_GENERATOR "TGZ")
ENDIF(WIN32)
INCLUDE(CPack)
# Install assets and dependencies