-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (54 loc) · 1.63 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
cmake_minimum_required(VERSION 3.13)
project(DarkOrbit VERSION 0.1.0)
find_package(sfml REQUIRED COMPONENTS Graphics)
find_package(spdlog REQUIRED)
set(SOURCES
src/main.cpp
src/core/Constants.cpp
src/core/Exception.cpp
src/engine/ScreenManager.cpp
src/engine/TextureManager.cpp
src/game/Formulas.cpp
src/screens/SpaceMap.cpp
src/utils/Factories.cpp
src/utils/SfmlDebug.cpp
src/utils/SfmlText.cpp
)
set(HEADERS
src/core/Constants.hpp
src/core/Exception.hpp
src/engine/Screen.hpp
src/engine/ScreenManager.hpp
src/engine/TextureManager.hpp
src/game/Formulas.hpp
src/game/PlayerStats.hpp
src/game/ShipStats.hpp
src/screens/SpaceMap.hpp
src/utils/Factories.hpp
src/utils/SfmlDebug.hpp
src/utils/SfmlText.hpp
)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
$<$<PLATFORM_ID:Windows>:WIN32_LEAN_AND_MEAN>
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
sfml-graphics
spdlog::spdlog
)
if(CMAKE_CXX_COMPILER_ID IN_LIST "GNU;Clang")
target_compile_options(${PROJECT_NAME}
PRIVATE
-Wall -Wextra
$<$<NOT:$<STREQUAL:${CMAKE_CXX_SIMULATE_ID},MSVC>>:-pedantic-errors>
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(${PROJECT_NAME}
PRIVATE
/EHsc # Enable exception stack unwinding
)
endif()