-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
73 lines (60 loc) · 1.89 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
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (NutmegCore)
SET (BUILD_ROOT ${CMAKE_CURRENT_BINARY_DIR})
SET (LIBRARY_OUTPUT_PATH ${BUILD_ROOT})
SET (EXECUTABLE_OUTPUT_PATH ${BUILD_ROOT})
SET (RUNTIME_OUTPUT_DIRECTORY ${BUILD_ROOT})
MESSAGE ("Source located in " ${PROJECT_SOURCE_DIR})
IF (UNIX)
SET (FLAGS -Wall)
IF (USE_CLANG)
#SET (FLAGS ${FLAGS} "")
SET (CMAKE_C_COMPILER "/usr/bin/clang")
SET (CMAKE_CXX_COMPILER "/usr/bin/clang++")
SET (CMAKE_AR "/usr/bin/llvm-ar")
SET (CMAKE_LINKER "/usr/bin/llvm-ld")
SET (CMAKE_NM "/usr/bin/llvm-nm")
SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
SET (CMAKE_RANLIB "/usr/bin/llvm-ranlib")
ELSE ()
SET (FLAGS ${FLAGS} -Wno-parentheses)
ENDIF ()
SET (CMAKE_C_FLAGS "-Wall -Wno-parentheses")
SET (CMAKE_C_FLAGS_DEBUG "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
SET (CMAKE_CXX_FLAGS "-Wall -Wno-parentheses -Wno-strict-overflow -Wno-maybe-uninitialized")
SET (CMAKE_CXX_FLAGS_DEBUG "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
ENDIF ()
IF (WIN32)
ADD_DEFINITIONS (-DNUTMEG_PLATFORM_WINDOWS)
ENDIF()
IF(UNIX)
ADD_DEFINITIONS (-DNUTMEG_PLATFORM_LINUX)
endIF()
SET (NUTMEG_INCLUDES
CoreSrc
CoreSrc/Common
CoreSrc/Audio
CoreSrc/Platform
CoreSrc/Engine
CoreSrc/Game
CoreSrc/Math
CoreSrc/Physics
CoreSrc/Render
CoreSrc/Scene
Library/Squall
Library/OpenGL
Library/Newton
Library/DevIL)
INCLUDE_DIRECTORIES (${NUTMEG_INCLUDES})
LINK_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
LINK_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/External)
ADD_SUBDIRECTORY (CoreSrc)
ADD_SUBDIRECTORY (Library)
ADD_SUBDIRECTORY (Subsystems)
ADD_SUBDIRECTORY (Samples)