-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (81 loc) · 3.93 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
cmake_minimum_required(VERSION 3.1)
project(Prototype VERSION 0.1.0)
SET(PROTOTYPE_ENABLE_ASSERTIONS OFF CACHE BOOL "")
SET(PROTOTYPE_ENABLE_PROFILER ON CACHE BOOL "")
SET(PROTOTYPE_ENABLE_PHYSX_DEBUG OFF CACHE BOOL "")
SET(PROTOTYPE_ENGINE_MODE ON CACHE BOOL "")
set(PROTOTYPE_RELEASE_BUILD ON CACHE BOOL "")
if(PROTOTYPE_RELEASE_BUILD)
add_compile_definitions(PROTOTYPE_TARGET_RELEASE_BUILD)
endif(PROTOTYPE_RELEASE_BUILD)
if(PROTOTYPE_ENABLE_ASSERTIONS)
add_compile_definitions(PROTOTYPE_ASSERTIONS_ENABLED)
endif(PROTOTYPE_ENABLE_ASSERTIONS)
if(PROTOTYPE_ENABLE_PROFILER)
add_compile_definitions(PROTOTYPE_ENABLE_PROFILER)
endif(PROTOTYPE_ENABLE_PROFILER)
if(PROTOTYPE_ENABLE_PHYSX_DEBUG)
add_compile_definitions(PROTOTYPE_DEBUG_PHYSX)
endif(PROTOTYPE_ENABLE_PHYSX_DEBUG)
if(PROTOTYPE_ENGINE_MODE)
add_compile_definitions(PROTOTYPE_ENGINE_DEVELOPMENT_MODE)
endif(PROTOTYPE_ENGINE_MODE)
# First for the generic no-config case (e.g. with mingw)
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
# Second, for multi-config builds (e.g. msvc)
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/PrototypeCompiler/llvm-project/build/lib/cmake/llvm)
set(PROTOTYPE_CMAKE_ASSETS_LOCAL_DIR "\"${CMAKE_BINARY_DIR}/bin/assets/\"")
set(PROTOTYPE_CMAKE_ASSETS_DIR "\"assets/\"")
set(PROTOTYPE_PLUGINS_DIR "\"../../../PrototypePlugins/\"")
if (CMAKE_BUILD_TYPE MATCHES Release)
set(CMAKE_BUILD_TYPE_STR "Release")
elseif (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_BUILD_TYPE_STR "Debug")
else()
message(FATAL_ERROR "Please set CMAKE_BUILD_TYPE to <Debug|Release>")
endif()
string(TOLOWER ${CMAKE_BUILD_TYPE_STR} CMAKE_BUILD_TYPE_STR_TOLOWER)
if(WIN32)
add_subdirectory(PrototypeCommon/cmake/windows)
add_subdirectory(PrototypeTraitSystem/cmake/windows)
add_subdirectory(PrototypeEngine/cmake/windows)
add_subdirectory(PrototypeApplication/cmake/windows)
add_subdirectory(PrototypeInterface/cmake/windows)
add_subdirectory(PrototypeGenerator/cmake/windows)
add_subdirectory(PrototypeTranspiler/cmake/windows)
add_dependencies(PrototypeCompiler PrototypeGenerator PrototypeTranspiler)
add_subdirectory(PrototypePlugins)
elseif(APPLE)
add_subdirectory(PrototypeCommon/cmake/darwin)
add_subdirectory(PrototypeTraitSystem/cmake/darwin)
add_subdirectory(PrototypeEngine/cmake/darwin)
add_subdirectory(PrototypeApplication/cmake/darwin)
add_subdirectory(PrototypeTranspiler/cmake/darwin)
add_subdirectory(PrototypeGenerator/cmake/darwin)
elseif(UNIX AND NOT APPLE)
add_subdirectory(PrototypeCommon/cmake/linux)
add_subdirectory(PrototypeTraitSystem/cmake/linux)
add_subdirectory(PrototypeEngine/cmake/linux)
add_subdirectory(PrototypeApplication/cmake/linux)
add_subdirectory(PrototypeInterface/cmake/linux)
add_subdirectory(PrototypeGenerator/cmake/linux)
add_subdirectory(PrototypeTranspiler/cmake/linux)
add_dependencies(PrototypeCompiler PrototypeGenerator PrototypeTranspiler)
add_subdirectory(PrototypePlugins)
else()
message(FATAL_ERROR "Operating System Not Supported.")
endif()
add_dependencies(PrototypeTraitSystem PrototypeCommon)
add_dependencies(PrototypeEngine PrototypeCommon PrototypeTraitSystem)
if(NOT EMSCRIPTEN)
add_dependencies(PrototypeInterface PrototypeEngine)
endif()
add_dependencies(PrototypeApplication PrototypeCommon PrototypeTraitSystem PrototypeEngine)