-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (45 loc) · 2.14 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
cmake_minimum_required(VERSION 3.10)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(GitVersionDetect)
set(WW1GAME_VERSION_MAJOR ${GITVERSIONDETECT_VERSION_MAJOR})
set(WW1GAME_VERSION_MINOR ${GITVERSIONDETECT_VERSION_MINOR})
set(WW1GAME_VERSION_PATCH ${GITVERSIONDETECT_VERSION_PATCH})
set(WW1GAME_VERSION ${GITVERSIONDETECT_VERSION_MAJOR}.${GITVERSIONDETECT_VERSION_MINOR}.${GITVERSIONDETECT_VERSION_PATCH})
set(WW1GAME_NUM_COMMIT ${GITVERSIONDETECT_VERSION_COMMIT_NUM}-${GITVERSIONDETECT_VERSION_COMMIT_SHA})
add_compile_definitions(ARFMINESWEEPER_VERSION="${WW1GAME_VERSION}")
add_compile_definitions(ARFMINESWEEPER_NUM_COMMIT="${WW1GAME_NUM_COMMIT}")
message(STATUS "Git version ${WW1GAME_VERSION}-${WW1GAME_NUM_COMMIT}")
project(
ww1game
VERSION ${WW1GAME_VERSION}
DESCRIPTION "Generic 2D arcade WW1 game using SDL2"
HOMEPAGE_URL "http://github.org/arf20/arfminesweeper"
LANGUAGES CXX
)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
include_directories("/usr/local/include")
link_directories("/usr/local/lib")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
file (GLOB SRC
"src/*.cpp"
)
add_executable(ww1game ${SRC})
target_link_libraries(ww1game PRIVATE Threads::Threads SDL2main SDL2 SDL2_ttf SDL2_image SDL2_mixer)
set_property(TARGET ww1game PROPERTY VERSION ${WW1GAME_VERSION})
install(TARGETS ww1game RUNTIME DESTINATION game COMPONENT bin)
install(DIRECTORY assets/ DESTINATION share/ww1game/assets COMPONENT data)
set(CPACK_PACKAGE_NAME ww1game)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_PACKAGE_VERSION ${GITVERSIONDETECT_VERSION})
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "arf20 <[email protected]>")
set(CPACK_DEBIAN_BIN_PACKAGE_DEPENDS "ww1game-data, libsdl2-2.0-0, libsdl2-ttf-2.0-0, libsdl2-image-2.0-0, libsdl2-mixer-2.0-0, libstdc++6, libc6, libgcc-s1")
set(CPACK_DEBIAN_BIN_PACKAGE_NAME "ww1game")
set(CPACK_DEBIAN_BIN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_DATA_PACKAGE_DEPENDS "")
set(CPACK_DEBIAN_DATA_PACKAGE_NAME "ww1game-data")
set(CPACK_DEBIAN_DATA_PACKAGE_SECTION "games")
include(CPack)