-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1000 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
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(Simple-Vector
LANGUAGES CXX
VERSION 1.3.0
)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
include("get_cpm")
add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(
${PROJECT_NAME}
INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)
target_compile_features(
${PROJECT_NAME}
INTERFACE
cxx_std_20
# msvc disabled ranges for c++20; force /std:c++latest instead
$<$<CXX_COMPILER_ID:MSVC>:cxx_std_23>
)
OPTION(${PROJECT_NAME}_BUILD_TESTS "Determines whether tests will be build or not." OFF)
if (${PROJECT_NAME}_BUILD_TESTS)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests")
endif()
OPTION(${PROJECT_NAME}_BUILD_EXAMPLES "Determines whether examples will be build or not." OFF)
if (${PROJECT_NAME}_BUILD_EXAMPLES)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/examples")
endif()
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/docs")