forked from tihine/Gloutrobate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (35 loc) · 1.32 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
cmake_minimum_required(VERSION 3.15)
cmake_policy(VERSION 3.15)
include(FetchContent)
project(GLOUTROBATE VERSION 1.0.0 LANGUAGES CXX)
if(WIN32)
# SonarLint support for CMake requires the following flag to be set on.
#(see https://community.sonarsource.com/t/sonarlint-for-visual-studio-v4-38-support-cmake-projects/50127)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
set (BUILD_SHARED_LIBS FALSE)
if(APPLE)
find_package(SFML 2.5 COMPONENTS system window graphics network audio REQUIRED)
include_directories(${SFML_INCLUDE_DIRS})
else()
# Linux or Windows
FetchContent_Declare(
sfml
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.5.1
)
FetchContent_MakeAvailable(sfml)
endif()
FetchContent_Declare(
box2d
GIT_REPOSITORY https://github.com/erincatto/box2d.git
GIT_TAG origin/main
)
FetchContent_MakeAvailable(box2d)
set(CMAKE_CXX_STANDARD 20)
add_subdirectory(mainLauncher)
add_subdirectory(src)
# enable_testing() must be in the source directory root (see cmake documentation at https://cmake.org/cmake/help/latest/command/enable_testing.html)
# Otherwise, Visual Studio test explorer does not see unit tests (See ticket https://developercommunity.visualstudio.com/t/No-tests-discovered-for-googletest-and-C/1148799#T-ND1150621)
enable_testing()
add_subdirectory(unitTests)