-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (32 loc) · 1.15 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
cmake_minimum_required(VERSION 3.26)
project(sillysprites
VERSION 0.0.1
DESCRIPTION "a 2D game engine written in C++"
HOMEPAGE_URL "https://github.com/mgerhold/silly-sprites/"
LANGUAGES C CXX # C is required by some of the dependencies
)
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed")
endif ()
# the value of CMAKE_CXX_STANDARD serves as a default for all subsequent targets
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# don't allow the usage of compiler-specific extensions to improve portability
set(CMAKE_CXX_EXTENSIONS OFF)
# activate LTO (link-time optimizations) to increase the chance of catching ODR violations
include(cmake/lto.cmake)
try_enable_link_time_optimizations()
include(${CMAKE_SOURCE_DIR}/dependencies.cmake)
setup_dependencies()
add_subdirectory(doc)
add_subdirectory(src bin)
add_subdirectory(test)
add_subdirectory(vendor)
include(${CMAKE_SOURCE_DIR}/cmake/CPM.cmake)
CPMAddPackage(
NAME GOOGLE_TEST
GITHUB_REPOSITORY google/googletest
VERSION 1.13.0
OPTIONS
"INSTALL_GTEST OFF"
)