-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (61 loc) · 1.6 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.10)
set(GAME hag)
project(${GAME}
VERSION 0.1.0
)
include(GNUInstallDirs)
find_package(gf REQUIRED COMPONENTS graphics)
find_package(SFML REQUIRED COMPONENTS audio)
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif ()
set(GAME_DATADIR "${CMAKE_INSTALL_PREFIX}/share/games/${GAME}" CACHE PATH "Game Data Dir")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/code/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
add_executable(${GAME}
code/main.cc
code/bits/AudioManager.cc
code/bits/ButtonsEntity.cc
code/bits/Constants.cc
code/bits/GameData.cc
code/bits/GameHub.cc
code/bits/GameRaw.cc
code/bits/GameScenery.cc
code/bits/GameState.cc
code/bits/HeroEntity.cc
code/bits/LayerEntity.cc
code/bits/LevelData.cc
code/bits/LevelScene.cc
code/bits/LevelScenery.cc
code/bits/PhysicsModel.cc
code/bits/StartScene.cc
code/bits/TitleEntity.cc
code/bits/MenuScene.cc
code/bits/MenuTitleEntity.cc
code/bits/QuitScene.cc
code/bits/LevelState.cc
code/bits/LeverEntity.cc
code/bits/SelectLevelScene.cc
code/bits/CreditEntity.cc
code/bits/CreditScene.cc
)
target_include_directories(${GAME}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/code
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(${GAME}
PRIVATE
gf::graphics
sfml-audio
)
install(
TARGETS ${GAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/${GAME}"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/games"
)
# tools
add_executable(tiles code/tiles.cc)
target_link_libraries(tiles gf::core)