-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
86 lines (74 loc) · 3.94 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
cmake_minimum_required(VERSION 2.8)
#cmake_policy(SET CMP0014 OLD) # do not warn about empty directories
project(ROOT C CXX)
# cotire
# set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# include(cotire)
UNSET(BUILD_FRAMEWORKS CACHE)
UNSET(BUILD_DEMOS CACHE)
UNSET(BUILD_TESTS CACHE)
OPTION(BUILD_FRAMEWORKS "Enable this to build *all* frameworks" ON)
OPTION(BUILD_DEMOS "Enable this to build *all* demos" ON)
OPTION(BUILD_TESTS "Enable this to build *all* tests" ON)
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} )
if(MSVC)
add_definitions(/EHsc /MP)
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
add_definitions(/wd4244) # dear MSVC, im fully aware and confident about my type conversions. stop hammering me. kthx :s
if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
add_definitions("/DDEBUG /Zi /Oy-")
else()
add_definitions("/DNDEBUG /D_NDEBUG /Zi /Oy- /Ox")
endif()
endif(MSVC)
## include <moon9/*>
include_directories("src")
if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/debug)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/debug)
if(BUILD_FRAMEWORKS)
add_subdirectory("deps/audio" ./.trash/debug/deps-audio)
add_subdirectory("src/moon9/audio" ./.trash/debug/audio)
## add_subdirectory("src/moon9/hub" ./.trash/debug/hub)
add_subdirectory("src/moon9/debug" ./.trash/debug/debug)
add_subdirectory("src/moon9/hid" ./.trash/debug/hid)
add_subdirectory("src/moon9/io" ./.trash/debug/io)
add_subdirectory("src/moon9/math" ./.trash/debug/math)
add_subdirectory("src/moon9/memtracer" ./.trash/debug/memtracer)
add_subdirectory("src/moon9/os" ./.trash/debug/os)
add_subdirectory("src/moon9/play" ./.trash/debug/play)
add_subdirectory("src/moon9/render" ./.trash/debug/render)
add_subdirectory("src/moon9/spatial" ./.trash/debug/spatial)
add_subdirectory("src/moon9/string" ./.trash/debug/string)
add_subdirectory("src/moon9/test" ./.trash/debug/test)
add_subdirectory("src/moon9/time" ./.trash/debug/time)
endif()
else()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/release)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/release)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/release)
if(BUILD_FRAMEWORKS)
add_subdirectory("deps/audio" ./.trash/release/deps-audio)
add_subdirectory("src/moon9/audio" ./.trash/release/audio)
## add_subdirectory("src/moon9/hub" ./.trash/release/hub)
add_subdirectory("src/moon9/debug" ./.trash/release/debug)
add_subdirectory("src/moon9/hid" ./.trash/release/hid)
add_subdirectory("src/moon9/io" ./.trash/release/io)
add_subdirectory("src/moon9/math" ./.trash/release/math)
add_subdirectory("src/moon9/memtracer" ./.trash/release/memtracer)
add_subdirectory("src/moon9/os" ./.trash/release/os)
add_subdirectory("src/moon9/play" ./.trash/release/play)
add_subdirectory("src/moon9/render" ./.trash/release/render)
add_subdirectory("src/moon9/spatial" ./.trash/release/spatial)
add_subdirectory("src/moon9/string" ./.trash/release/string)
add_subdirectory("src/moon9/test" ./.trash/release/test)
add_subdirectory("src/moon9/time" ./.trash/release/time)
endif()
endif()
if(BUILD_TESTS)
include_directories("deps/play/msgpack/src")
file(GLOB_RECURSE ALL_TESTS "src/moon9/*.test.cpp")
add_executable(ALL.TESTS "src/moon9/test/test.cpp" ${ALL_TESTS})
target_link_libraries(ALL.TESTS moon9-test-static moon9-string-static moon9-time-static msgpack-static)
endif()