-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
57 lines (43 loc) · 1.64 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.3)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
SET(ENGINE_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
SET(ENGINE_SRC_PATH ${ENGINE_ROOT}/src)
SET(ENGINE_RES_PATH ${ENGINE_ROOT}/res)
SET(ENGINE_3RDPARTY_PATH ${ENGINE_ROOT}/3rdparty)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# Engine project is C++
PROJECT(Engine CXX)
INCLUDE(configs)
INCLUDE(projects)
# Setup ISPC
SET(ISPC_TARGETS avx2)
SET(ENABLE_ISPC_SUPPORT YES)
INCLUDE(ispc)
# Output directories.
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin)
# Add third party libraries.
ADD_SUBDIRECTORY("3rdparty")
# Enable Remotery DLL support for debug & optimized.
ADD_DEFINITIONS(-DRMT_DLL=1)
SET_PROPERTY( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG> $<$<CONFIG:Debug>:RMT_ENABLED=1> )
SET_PROPERTY( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Optimized>:OPTIMIZED> $<$<CONFIG:Optimized>:RMT_ENABLED=1> $<$<CONFIG:Optimized>:NDEBUG> )
# Version.
SET(ENGINE_MAJOR_VERSION 0)
SET(ENGINE_MINOR_VERSION 0)
SET(ENGINE_MICRO_VERSION 0)
SET(ENGINE_VERSION "${ENGINE_MAJOR_VERSION}.${ENGINE_MINOR_VERSION}.${ENGINE_MICRO_VERSION}")
IF(MSVC)
# Setup warning level.
ADD_DEFINITIONS(/W4) # level 4
ADD_DEFINITIONS(/WX) # warnings as errors
ADD_DEFINITIONS(/wd4100) # disable unreferenced formal parameter
ENDIF()
INCLUDE_DIRECTORIES(
"${ENGINE_SRC_PATH}"
# 3rdparty.
"${ENGINE_3RDPARTY_PATH}/Remotery/lib"
)
ADD_SUBDIRECTORY("src")
ADD_SUBDIRECTORY("apps")