-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
40 lines (32 loc) · 941 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
36
37
38
39
40
cmake_minimum_required(VERSION 3.23)
include("cmake/version.cmake")
project(
bsa
VERSION "${BSA_VERSION_MAJOR}.${BSA_VERSION_MINOR}.${BSA_VERSION_PATCH}"
LANGUAGES CXX
)
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|GNU")
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "in-source builds are not allowed")
endif()
option(BSA_BUILD_SRC "whether we should build the library itself" ON)
if("${BSA_BUILD_SRC}")
add_subdirectory(src)
endif()
option(BSA_BUILD_EXAMPLES "whether we should build the examples" OFF)
if("${BSA_BUILD_EXAMPLES}")
add_subdirectory(examples)
endif()
include(CTest)
if("${BUILD_TESTING}")
find_package(Catch2 3 REQUIRED CONFIG)
include(Catch)
add_subdirectory(tests)
endif()
option(BSA_BUILD_DOCS "whether we should build documentation" OFF)
if("${BSA_BUILD_DOCS}")
add_subdirectory(docs)
endif()