forked from wrazik/TankBotFight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
92 lines (79 loc) · 2.45 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
cmake_minimum_required(VERSION 3.18)
set(CMAKE_TOOLCHAIN_FILE "./vcpkg/scripts/buildsystems/vcpkg.cmake")
project(TankBotFight)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(CTest)
include(clang-tidy)
option(ENABLE_CLANG_TIDY "Enables 'make tidy' command to run clang-tidy checks"
OFF)
set(CLANG_TIDY_VERSION
"12"
CACHE STRING "Clang tidy version to run checks")
if(ENABLE_CLANG_TIDY)
add_tidy_target(
${CLANG_TIDY_VERSION}
FILES
${CMAKE_SOURCE_DIR}/src/*
${CMAKE_SOURCE_DIR}/src/background/*
${CMAKE_SOURCE_DIR}/src/Controllers/*
${CMAKE_SOURCE_DIR}/src/Tank/*
${CMAKE_SOURCE_DIR}/src/Players/*)
endif()
add_library(
tank_bot_fight_lib STATIC
src/background/Background.cpp
src/background/BackgroundTextureName.cpp
src/background/Ground.cpp
src/background/RoadGenerator.cpp
src/background/SurfaceGenerator.cpp
src/Animation.cpp
src/Board.cpp
src/Controllers/KeyboardController.cpp
src/Controllers/DummyController.cpp
src/Missle.cpp
src/Tank/Tank.cpp
src/Tank/TankFactory.cpp
src/Tank/TankPart.cpp
src/Tank/TankTurret.cpp
src/Tank/TankHealthBar.cpp
src/TextureStore.cpp
src/Random.cpp
src/SquareRootEngine.cpp
src/TracesHandler.cpp
src/Trace.cpp
src/Players/DummyPlayer.cpp
src/Players/KeyboardPlayer.cpp
src/Sound.cpp
src/MainMenu.cpp
src/GameManager.cpp
src/MenuLevel.cpp
src/Button.cpp
src/MenuItem.cpp
)
target_include_directories(tank_bot_fight_lib PRIVATE src)
add_executable(tank_bot_fight src/main.cpp)
if(MSVC)
target_compile_options(tank_bot_fight PRIVATE /W3 /WX
$<$<CONFIG:Release>:/O2>)
else()
target_compile_options(tank_bot_fight PRIVATE -Wall -pedantic -Werror -Wextra
-O3)
endif()
target_include_directories(tank_bot_fight PRIVATE src)
find_package(
SFML 2.5.1
COMPONENTS graphics audio
REQUIRED)
find_package(range-v3 REQUIRED)
find_package(Microsoft.GSL CONFIG REQUIRED)
if (APPLE)
find_package(OpenAL REQUIRED)
target_link_libraries(tank_bot_fight PRIVATE OpenAL::OpenAL)
endif()
target_link_libraries(tank_bot_fight_lib PUBLIC sfml-graphics ${EXTRA_LIBS}
Microsoft.GSL::GSL)
target_link_libraries(tank_bot_fight PRIVATE tank_bot_fight_lib sfml-graphics sfml-audio)
add_subdirectory(test)