This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
104 lines (89 loc) · 3.08 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
# RAPTR, the best around.
project(raptr
VERSION 0.1
LANGUAGES CXX)
# Include additional custom cmake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
# Options for the project
option(BUILD_DOCS "Build documentation" ON)
option(BUILD_TESTS "Build tests" ON)
# Imported target: SDL2
find_package(SDL2 CONFIG REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_TTF REQUIRED)
find_package(SDL2_Mixer REQUIRED)
find_package(SDL2_Net REQUIRED)
find_package(Picojson REQUIRED)
find_package(cxxopts REQUIRED)
find_package(spdlog REQUIRED)
find_package(fmt REQUIRED)
find_package(tinytoml REQUIRED)
find_package(crossguid CONFIG REQUIRED)
find_package(Lua REQUIRED)
find_package(sol2 CONFIG REQUIRED)
find_package(OpenGL REQUIRED)
find_package(DiscordRPC REQUIRED)
add_library(RaptrDependencies INTERFACE)
target_link_libraries(RaptrDependencies INTERFACE
cxxopts::cxxopts
SDL2::SDL2
sdl2_ttf::sdl2_ttf
Picojson::Picojson
spdlog::spdlog
fmt::fmt
tinytoml::tinytoml
sdl2_net::sdl2_net
sdl2_mixer::sdl2_mixer
discord_rpc::discord_rpc
crossguid
sol2::sol2
${OPENGL_LIBRARIES}
${LUA_LIBRARIES}
${SDL2_LIBRARIES}
${SDL2_IMAGE_LIBRARIES}
)
target_include_directories(RaptrDependencies INTERFACE
$<TARGET_PROPERTY:cxxopts::cxxopts,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:SDL2::SDL2,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:sdl2_ttf::sdl2_ttf,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:sdl2_net::sdl2_net,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:sdl2_mixer::sdl2_mixer,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Picojson::Picojson,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:spdlog::spdlog,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:fmt::fmt,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:tinytoml::tinytoml,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:crossguid,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:sol2::sol2,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:discord_rpc::discord_rpc,INTERFACE_INCLUDE_DIRECTORIES>
${OPENGL_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
${SDL2_INCLUDE_DIRS}
${SDL2_IMAGE_INCLUDE_DIRS}
)
# Make the project importable
install(EXPORT RaptrConfig DESTINATION share/Raptr/cmake)
# 'make install' to the correct locations
install(TARGETS RaptrDependencies EXPORT RaptrConfig
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
# Unfortunately, cmake doesn't support this yet
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /MP")
endif(MSVC)
# Enable solution folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_subdirectory(engine)
add_subdirectory(application)
add_subdirectory(game)
# Targets that we develop under RAPTR
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
# Check if doxygen is installed and available
if (BUILD_DOCS)
add_subdirectory(doc)
endif(BUILD_DOCS)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT raptr-client)