-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (28 loc) · 868 Bytes
/
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
cmake_minimum_required(VERSION 3.24)
project(SimEvo)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# check if the compiler supports C++20
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
if(COMPILER_SUPPORTS_CXX20)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
else()
message(
FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} does not support C++20.")
endif()
# include the headers
include_directories(include)
# add the subdirectories
add_subdirectory(src)
# using BUILD_BINDINGS to enable/disable the python bindings
option(BUILD_BINDINGS "Build Python bindings" ON)
if(BUILD_BINDINGS)
add_subdirectory(bindings)
endif()
# using BUILD_TESTS to enable/disable the tests
option(BUILD_TESTS "Build the test programs" OFF)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests/cpp)
endif()