-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
51 lines (42 loc) · 1.69 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
cmake_minimum_required(VERSION 3.23)
cmake_policy(SET CMP0048 NEW) # project() command manages VERSION variables
project(UUtils VERSION 2.0.6 HOMEPAGE_URL "https://github.com/UPPAALModelChecker/UUtils" LANGUAGES CXX C)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
include(FetchContent)
# set(FETCHCONTENT_QUIET FALSE) # for debugging FetchContent
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUID_TYPE Release)
endif ()
option(UUtils_WITH_TESTS "Enable UUtils unit tests" ON)
option(UUtils_WITH_BENCHMARKS "Enable UUtils benchmarks (depends on tests)" OFF)
option(FIND_FATAL "Stop if find_package fails, do not attempt FetchContent" OFF)
include(cmake/stdcpp.cmake)
include(cmake/sanitizer.cmake)
if(UUtils_WITH_TESTS)
include(cmake/doctest.cmake)
message(STATUS "Enabled Unit Tests")
endif (UUtils_WITH_TESTS)
if (UUtils_WITH_BENCHMARKS)
include(cmake/benchmark.cmake)
message(STATUS "Enabled Benchmarks")
endif (UUtils_WITH_BENCHMARKS)
include(cmake/xxhash.cmake)
set(BOOST_INCLUDE_LIBRARIES headers math)
include(cmake/boost.cmake)
if(UUtils_WITH_TESTS)
enable_testing()
endif (UUtils_WITH_TESTS)
set(MODULES base debug hash)
foreach(MODULE ${MODULES})
add_subdirectory("src/${MODULE}")
endforeach()
if(UUtils_WITH_TESTS)
foreach(MODULE ${MODULES})
add_subdirectory("test/${MODULE}")
endforeach()
endif(UUtils_WITH_TESTS)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/UUtilsConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion)
install(EXPORT UUtilsConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UUtils/ NAMESPACE UUtils::)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/UUtilsConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UUtils )