RythmGame/SimpleGame/CMakeLists.txt
2025-06-13 01:25:45 +02:00

35 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.26)
include(FetchContent)
project(SimpleGame VERSION 1.0.0 LANGUAGES CXX)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
set (BUILD_SHARED_LIBS FALSE)
FetchContent_Declare(sfml
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 3.0.0
GIT_SHALLOW ON
EXCLUDE_FROM_ALL
SYSTEM)
FetchContent_MakeAvailable(sfml)
set(CMAKE_CXX_STANDARD 23)
add_subdirectory(src)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/releases/download/v1.16.0/googletest-1.16.0.tar.gz
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# 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)
include(GoogleTest)
enable_testing()