-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
54 lines (44 loc) · 1.47 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
cmake_minimum_required(VERSION 3.16)
message(STATUS "Configuring Client")
add_executable(Client "")
target_include_directories(Client
PRIVATE
${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS}
${SDL2_MIXER_INCLUDE_DIRS} ${SDL2_TTF_INCLUDE_DIRS}
${SDL2PP_INCLUDE_DIRS}
)
# Inherit Shared's precompiled header.
target_precompile_headers(Client REUSE_FROM Shared)
target_link_libraries(Client
PRIVATE
-static-libgcc
-static-libstdc++
${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES}
${SDL2_MIXER_LIBRARIES} ${SDL2_TTF_LIBRARIES}
${SDL2_GFX_LIBRARIES} ${SDL2PP_LIBRARIES}
SDL2pp
Bitsery::bitsery
readerwriterqueue
CircularBuffer
EnTT::EnTT
Shared
)
# Compile with C++20
target_compile_features(Client PRIVATE cxx_std_20)
set_target_properties(Client PROPERTIES CXX_EXTENSIONS OFF)
# Enable compile warnings.
target_compile_options(Client PUBLIC -Wall -Wextra)
add_custom_command(
TARGET Client POST_BUILD
# Copy resource files to the build directory.
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/../Resources/
${CMAKE_CURRENT_BINARY_DIR}/Resources/
)
# Build all of the subdirectories
add_subdirectory(Config)
add_subdirectory(Launch)
add_subdirectory(Network)
add_subdirectory(Renderer)
add_subdirectory(Simulation)
add_subdirectory(UserInterface)