-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (55 loc) · 2.06 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
cmake_minimum_required(VERSION 3.6)
cmake_policy(SET CMP0091 NEW) # for specifying MSVC RuntimeLibrary
project(PaxEngine3)
### DEFINITIONS #########################################
# Detect if standalone or included as subdirectory
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(PAX3STANDALONE TRUE)
message("Building PaxEngine3 as standalone.")
else()
set(PAX3STANDALONE FALSE)
message("Building PaxEngine3 as library.")
endif()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
if (${PAX3STANDALONE})
set(PAX_LIB_DIR_RELATIVE ../pax3libs)
include(cmake/PaxSetup.cmake)
endif()
### CONFIGURE MSVC #####################################
if (WIN32 AND ${PAX_COMPILER_IS_MSVC})
if (PAX_BUILD_TYPE_RELEASE)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebugDLL")
endif()
message("Set MSVC RuntimeLibrary to ${CMAKE_MSVC_RUNTIME_LIBRARY}")
endif()
#set(CompilerFlags
# CMAKE_CXX_FLAGS
# CMAKE_CXX_FLAGS_DEBUG
# CMAKE_CXX_FLAGS_RELEASE
# CMAKE_C_FLAGS
# CMAKE_C_FLAGS_DEBUG
# CMAKE_C_FLAGS_RELEASE
# )
#foreach(CompilerFlag ${CompilerFlags})
# string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
#endforeach()
### FLAGS ###############################################
if (${PAX3ENGINE_STANDALONE})
set(CMAKE_CXX_STANDARD ${PAX_CXX_STANDARD_MINIMUM})
message("CMAKE_CXX_STANDARD is ${CMAKE_CXX_STANDARD}")
endif()
### INCLUDES ########################################
include_directories(include)
### API INCLUDES ########################################
message("=== Including Internal Libraries ===================================")
add_subdirectory(libs)
message("=== Including Internal Libraries DONE ==============================")
# Polypropylene
include_directories(libs/Polypropylene/include)
add_definitions(-DPAX_WITH_JSON)
### SUBDIRECTORIES ######################################
add_subdirectory(src)
### PLUGINS #############################################
add_subdirectory(plugins)