-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
87 lines (67 loc) · 2.43 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
cmake_minimum_required(VERSION 2.6)
set(CMAKE_C_COMPILER "emcc")
set(CMAKE_CXX_COMPILER "emcc")
include(CheckCXXCompilerFlag)
project(nx)
set (nx_VERSION_MAJOR 2)
set (nx_VERSION_MINOR 4)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(ASSET_DIRECTORY "../data")
# Using Emscriptens ports
#find_package(SDL2)
#find_package(SDL2_ttf)
#find_package(PNG)
#include_directories(${SDL2_INCLUDE_DIR})
#include_directories(${SDL2TTF_INCLUDE_DIR})
file(GLOB APP_SOURCES "src/[a-zA-Z]*.cpp")
file(GLOB TB_SOURCES "src/TextBox/[a-zA-Z]*.cpp")
file(GLOB_RECURSE AI_SOURCES "src/ai/[a-zA-Z]*.cpp")
file(GLOB AG_SOURCES "src/autogen/[a-zA-Z]*.cpp")
file(GLOB CM_SOURCES "src/common/[a-zA-Z]*.cpp")
file(GLOB EG_SOURCES "src/endgame/[a-zA-Z]*.cpp")
file(GLOB GR_SOURCES "src/graphics/[a-zA-Z]*.cpp")
file(GLOB IN_SOURCES "src/intro/[a-zA-Z]*.cpp")
file(GLOB PA_SOURCES "src/pause/[a-zA-Z]*.cpp")
file(GLOB SL_SOURCES "src/siflib/[a-zA-Z]*.cpp")
file(GLOB SN_SOURCES "src/sound/[a-zA-Z]*.cpp")
# We don't need to compile the extractor
#file(GLOB EXTR_SOURCES "src/extract/[a-zA-Z]*.cpp")
#set(EXTR_SOURCES
# ${EXTR_SOURCES}
# "src/common/misc.cpp"
# "src/common/stat.cpp"
# "src/stagedata.cpp"
#)
include_directories(${nx_SOURCE_DIR})
set(SOURCES
${APP_SOURCES}
${TB_SOURCES}
${AI_SOURCES}
${AG_SOURCES}
${CM_SOURCES}
${EG_SOURCES}
${GR_SOURCES}
${IN_SOURCES}
${PA_SOURCES}
${SL_SOURCES}
${SN_SOURCES}
)
option(DEBUG "build application with debug traces" OFF) # OFF is the default
option(MUTABLE_SCALE "build application with changable scale" ON) # OFF is the default
option(USE_TTF "build application with ttf font support" ON) # OFF is the default
if(DEBUG)
add_definitions(-DTRACE_SCRIPT)
endif(DEBUG)
if(MUTABLE_SCALE)
add_definitions(-DCONFIG_MUTABLE_SCALE)
endif(MUTABLE_SCALE)
if(USE_TTF)
add_definitions(-DCONFIG_ENABLE_TTF)
endif(USE_TTF)
add_definitions("-Wall -Werror -std=c++11 -g4 -O2")
add_definitions("-s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_LIBPNG=1 -s ASSERTIONS=1 -s SAFE_HEAP=1")
add_executable(game.html ${SOURCES})
set_target_properties(game.html PROPERTIES LINK_FLAGS "-Werror -s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_LIBPNG=1 -s TOTAL_MEMORY=67108864 -O2 --preload-file ${ASSET_DIRECTORY}")
#target_link_libraries(nx ${SDL2_LIBRARY} ${SDL2TTF_LIBRARY} ${PNG_LIBRARY})
#add_executable(extract ${EXTR_SOURCES})