-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
77 lines (59 loc) · 2.3 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
PROJECT(Genus)
ADD_COMPILE_DEFINITIONS(CE_SDL2_WINDOW_TITLE="Genus :: by Modus Create")
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-implicit-exception-spec-mismatch")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-implicit-exception-spec-mismatch")
include(ProcessorCount)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/creative-engine/cmake.files)
ADD_COMPILE_DEFINITIONS(__MODUS_TARGET_SDL2_AUDIO__=true)
ADD_COMPILE_DEFINITIONS(__MODUS_TARGET_DESKTOP_CONTROLS__=true)
ADD_COMPILE_DEFINITIONS(__MODUS_TARGET_DESKTOP_DISPLAY__=true)
# Include Creative Engine
# Exports:
# ${CREATIVE_ENGINE_INCLUDE_DIRS} - used in INCLUDE_DIRECTORIES(...)
# ${CREATIVE_ENGINE_SOURCE_FILES} - used in ADD_EXECUTABLE(...)
# ${CREATIVE_ENGINE_LINK_LIBRARIES} - used in TARGET_LINK_LIBRARIES(...)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/creative-engine/CreativeEngine.cmake)
SET(GENUS_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/GameState
${CMAKE_SOURCE_DIR}/src/GameState/Playfields
${CMAKE_SOURCE_DIR}/src/GameState/Powerups
${CMAKE_SOURCE_DIR}/src/GameState/PauseModal
${CMAKE_SOURCE_DIR}/src/GameOverState
${CMAKE_SOURCE_DIR}/src/HighScoresState
${CMAKE_SOURCE_DIR}/src/MainMenuState
${CMAKE_SOURCE_DIR}/src/MainOptionsState
${CMAKE_SOURCE_DIR}/src/SplashState
${CMAKE_SOURCE_DIR}/src/RulesState
${CMAKE_BINARY_DIR}/usr/local/include
)
INCLUDE_DIRECTORIES(
${GENUS_INCLUDE_DIRS}
${CREATIVE_ENGINE_INCLUDE_DIRS}
)
# gather Genus sources
FILE(GLOB_RECURSE GENUS_SRC RELATIVE ${CMAKE_SOURCE_DIR} "src/*.cpp")
ADD_EXECUTABLE(
${PROJECT_NAME}
Resources.bin
${CREATIVE_ENGINE_SOURCE_FILES}
${GENUS_SRC}
)
ProcessorCount(N)
if (NOT N EQUAL 0)
set(${PROJECT_NAME}_FLAGS -j${N})
set(${PROJECT_NAME}_BUILD_FLAGS -j${N})
set(${PROJECT_NAME}_args ${${PROJECT_NAME}_args} PARALLEL_LEVEL ${N})
endif ()
BUILD_COMMAND(
$(MAKE) --silent
)
# make genus.app
if (APPLE)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Developer ID Application: Modus Create, Inc.")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ".")
endif (APPLE)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CREATIVE_ENGINE_LINK_LIBRARIES})