-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
72 lines (48 loc) · 2.26 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
project(PuzzleMoppet)
cmake_minimum_required(VERSION 3.1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(BUILD_FOR_INSTALL "OFF" CACHE BOOL "Should the game search for its datas in install path")
set(DATA_DIR ${PROJECT_SOURCE_DIR}/data CACHE STRING "Directory for game data")
set(BUILD_FOR_APPIMAGE "OFF" CACHE BOOL "Building for AppImage")
if (BUILD_FOR_INSTALL)
set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/puzzlemoppet")
endif (BUILD_FOR_INSTALL)
add_definitions(-DDATA_DIR="${DATA_DIR}")
# find the absolute litha engine root directory
set(rootDir ${CMAKE_HOME_DIRECTORY})
########## LITHA ENGINE CONFIG ########
# Litha engine static library output directory
set(LIBRARY_OUTPUT_PATH ${rootDir}/lib/${lithaTargetName})
# Compile litha engine...
# (specific libraries needed only by Litha engine are set in this directory's CMakeLists.txt)
add_subdirectory(source)
########### PROJECTS CONFIG ############
# Project executable output path
set(EXECUTABLE_OUTPUT_PATH bin)
# Link to Litha Engine
link_directories(${rootDir}/lib/${lithaTargetName})
# Project libraries
set(projectLibs Litha)
# Project properties
if (exeExtension)
set(projectProperties PROPERTIES SUFFIX ${exeExtension})
endif (exeExtension)
########### PLATFORM SPECIFIC PROJECTS CONFIG ############
# Hide console window in Windows.
if (WIN32)
set(projectProperties ${projectProperties} WIN32_EXECUTABLE true)
endif (WIN32)
########### BUILD ALL PROJECTS ############
add_subdirectory(projects)
########### INSTALLATION DESTINATION ############
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/levels DESTINATION share/puzzlemoppet)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/media DESTINATION share/puzzlemoppet)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/perfectscores DESTINATION share/puzzlemoppet)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/tutorialtexts DESTINATION share/puzzlemoppet)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/tutorialtexts_mac DESTINATION share/puzzlemoppet)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/licenses/ DESTINATION share/licences/puzzlemoppet)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/icons DESTINATION share/puzzlemoppet)