-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
86 lines (67 loc) · 1.82 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.11)
project(sbepp
VERSION 1.5.0
LANGUAGES CXX
)
include(CTest)
include(CMakeDependentOption)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
include(utils)
sbepp_in_source_build_guard()
sbepp_set_language_standard(CXX 17)
sbepp_set_default_build_type(Release)
option(SBEPP_DEV_MODE "Developer mode" OFF)
cmake_dependent_option(SBEPP_BUILD_TESTS
"Build sbepp tests" OFF
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR"
OFF
)
# used primarily to speed up CI by running all unit tests as a single binary
cmake_dependent_option(SBEPP_SEPARATE_TESTS
"Treat each unit test separately in CTest" ON
"SBEPP_BUILD_TESTS"
OFF
)
cmake_dependent_option(SBEPP_BUILD_BENCHMARK
"Build sbepp benchmark" OFF
"SBEPP_DEV_MODE;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
)
option(SBEPP_BUILD_SBEPPC "Build sbeppc schema compiler" ON)
option(SBEPP_BUILD_DOCS "Build documentation" OFF)
add_subdirectory(sbepp)
if(SBEPP_BUILD_SBEPPC)
add_subdirectory(sbeppc)
endif()
if(SBEPP_BUILD_BENCHMARK)
add_subdirectory(benchmark)
endif()
if(SBEPP_BUILD_TESTS)
add_subdirectory(test)
endif()
if(SBEPP_BUILD_DOCS)
add_subdirectory(doc)
endif()
install(EXPORT sbepp
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sbepp
NAMESPACE sbepp::
)
write_basic_package_version_file(
"sbeppConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
)
install(
FILES cmake/sbeppConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sbepp
COMPONENT sbepp
)
install(
FILES "${PROJECT_BINARY_DIR}/sbeppConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sbepp
COMPONENT sbepp
)
install(
FILES cmake/sbeppcHelpers.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sbepp
)