-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (59 loc) · 1.72 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
cmake_minimum_required(VERSION 3.16)
project(
robotfindskitten
VERSION 1.0.0
LANGUAGES CXX
)
if(NOT
DEFINED
ENV{VCPKG_ROOT})
message(
FATAL_ERROR
"You must have vcpkg and set VCPKG_ROOT environment variable")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS
ON
CACHE INTERNAL "")
configure_file(${CMAKE_SOURCE_DIR}/src/config.h.in config.h @ONLY)
get_filename_component(
NPGAME_SCINTILLA_DIR
"${CMAKE_SOURCE_DIR}/extern/thirdparty/scintilla"
ABSOLUTE)
# dll injector
add_subdirectory(src/loader)
# game
add_subdirectory(src/robotfindskitten)
option(ROBOTFINDSKITTEN_BUILD_TESTING "Enable building tests." OFF)
if(ROBOTFINDSKITTEN_BUILD_TESTING)
find_package(GTest CONFIG REQUIRED)
enable_testing()
add_subdirectory(tests)
endif()
option(ROBOTFINDSKITTEN_BUILD_DOCS "Enable building with documentation." OFF)
if(ROBOTFINDSKITTEN_BUILD_DOCS)
set(DOXY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
set(DOXY_SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/")
find_package(Doxygen)
configure_file(DoxyFile.in DoxyFile @ONLY)
add_custom_target(
docs ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/DoxyFile
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/"
VERBATIM
SOURCES
"${CMAKE_CURRENT_BINARY_DIR}/DoxyFile"
)
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
DESTINATION docs
)
endif()
add_custom_target(
copy-compile-commands ALL
${CMAKE_COMMAND} -E copy_if_different
${CMAKE_BINARY_DIR}/compile_commands.json
"${CMAKE_SOURCE_DIR}/compile_commands.json"
)