-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·55 lines (41 loc) · 1.66 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
cmake_minimum_required(VERSION 3.10)
project(SpaceExtractor LANGUAGES CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
option(USE_SYSRONIN "Using system ronin-engine" ON)
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
file(GLOB_RECURSE HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp")
if(WIN32)
add_executable(SpaceExtractor WIN32 ${HEADERS} ${SOURCES})
else()
add_executable(SpaceExtractor ${HEADERS} ${SOURCES})
endif()
target_compile_features(SpaceExtractor PRIVATE cxx_std_17)
target_include_directories(SpaceExtractor PRIVATE src)
if(NOT USE_SYSRONIN)
set(RONIN_NO_CONFIG ON)
add_subdirectory(RoninEngine)
target_link_libraries(SpaceExtractor PRIVATE RoninEngine)
else()
find_package(PkgConfig)
if(NOT MSVC AND PkgConfig_FOUND)
pkg_check_modules(RoninEngine REQUIRED RoninEngine)
else()
find_package(RoninEngine REQUIRED)
endif()
target_include_directories(SpaceExtractor PRIVATE ${RoninEngine_INCLUDE_DIRS})
target_link_libraries(SpaceExtractor PRIVATE ${RoninEngine_LIBRARIES})
endif()
# set the executable name
set_target_properties(SpaceExtractor PROPERTIES OUTPUT_NAME game)
# create link resources "data:resources"
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(_DATA_DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data")
if(NOT EXISTS "${_DATA_DESTINATION}")
message(STATUS "Linking data to \"${_DATA_DESTINATION}\"")
file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/resources/data"
"${_DATA_DESTINATION}" SYMBOLIC)
else()
message(STATUS "Symbolic link exists - not required")
endif()
unset(_DATA_DESTINATION)