-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
76 lines (62 loc) · 2.28 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
cmake_minimum_required(VERSION 3.0)
project(spaceace
VERSION 0.1
LANGUAGES CXX C)
###########
# Debug or Release
###########
if (NOT CMAKE_BUILD_TYPE)
## set default to Debug
set(CMAKE_BUILD_TYPE RelWithDebInfo) # override with -DCMAKE_BUILD_TYPE=Release
message("==> CMAKE_BUILD_TYPE empty. Changing it to Debug.")
else()
message("==> CMAKE_BUILD_TYPE == ${CMAKE_BUILD_TYPE}.")
endif()
# Profiling - which does not work.
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
# SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
# add_definitions(-pg)
## https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html
## During Debug, use debug version of libstdc++ (asserts on access to invalid iterators, etc!)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
##############
# C++ Standard
##############
set(CMAKE_CXX_STANDARD 14)
# set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS ON)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/door++)
message("***")
message("*** ERROR/MISSING *** please run: git clone https://github.com/stevet11/door.git door++")
message("*** (Or whatever git clone you need for door++)")
message("***")
endif()
add_subdirectory(door++)
file(GLOB IMAGES
ansi/*.ans
)
add_custom_command(
OUTPUT images.h
COMMAND ./build_images.sh
DEPENDS ${IMAGES}
COMMENT "Generating images.h"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/SQLiteCpp)
message("***")
message("*** ERROR/MISSING *** please run: git clone https://github.com/SRombauts/SQLiteCpp.git --depth 1")
message("***")
endif()
set(SQLITECPP_RUN_CPPCHECK OFF CACHE BOOL "" FORCE)
set(SQLITECPP_RUN_CPPLINT OFF CACHE BOOL "" FORCE)
add_subdirectory(SQLiteCpp)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp)
message("***")
message("*** ERROR/MISSING *** please run: git clone https://github.com/jbeder/yaml-cpp.git --depth 1")
message("***")
endif()
add_subdirectory(yaml-cpp)
add_executable(space-ace main.cpp deck.cpp db.h db.cpp play.h play.cpp scores.h scores.cpp utils.h utils.cpp starfield.cpp starfield.h images.h)
target_link_libraries(space-ace door++ pthread SQLiteCpp sqlite3 dl yaml-cpp)