-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
52 lines (43 loc) · 1.29 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
42
43
44
45
46
47
48
49
50
51
52
cmake_policy(SET CMP0048 NEW) # enable use of VERSION in project() function
project(
fsmpp2
VERSION 0.4.0
HOMEPAGE_URL "https://github.com/lukaszgemborowski/fsmpp2"
LANGUAGES CXX
)
cmake_minimum_required(VERSION 3.16)
option(FSMPP2_USE_CPP20 "Use C++20 features (requires C++20 capable compiler)" OFF)
option(FSMPP2_TEST_ASAN "Enable ASan in tests" OFF)
option(FSMPP2_TEST_UBSAN "Enable UBSan in tests" OFF)
option(FSMPP2_BENCHMARK "Enable benchmarks target" OFF)
configure_file(
cmake/config.hpp.in
include/fsmpp2/config.hpp
)
add_library(fsmpp2 INTERFACE)
target_include_directories(
fsmpp2 INTERFACE
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include # configure_file will place config.hpp in BINARY_DIR
)
# enable either C++17 or C++20 compiler options
if (FSMPP2_USE_CPP20)
target_compile_features(fsmpp2 INTERFACE cxx_std_20)
else()
target_compile_features(fsmpp2 INTERFACE cxx_std_17)
endif()
# install all headers
install(
DIRECTORY include/fsmpp2
DESTINATION include
)
# explicitly install aut-generated config.hpp which is out-of-tree
install(
FILES ${CMAKE_BINARY_DIR}/include/fsmpp2/config.hpp
DESTINATION include/fsmpp2/
)
add_subdirectory(tests)
add_subdirectory(examples)
if (FSMPP2_BENCHMARK)
add_subdirectory(benchmarks)
endif ()