-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (40 loc) · 1.67 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
# Copyright (c) 2022 Dennis Hezel
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
cmake_minimum_required(VERSION 3.14...3.24)
project(
lambda-tuple
VERSION 1.0.0
DESCRIPTION "An implementation of `std::tuple` based on variadic lambda capture"
LANGUAGES CXX)
include(GNUInstallDirs)
# user options
option(LAMBDA_TUPLE_INSTALL "Create the install target" on)
set(LAMBDA_TUPLE_CMAKE_CONFIG_INSTALL_DIR
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
CACHE STRING "Install directory for CMake config files")
# maintainer options
option(LAMBDA_TUPLE_BUILD_TESTS "Build tests and examples" off)
option(LAMBDA_TUPLE_TEST_COVERAGE "Compile tests with --coverage" off)
set(LAMBDA_TUPLE_COVERAGE_OUTPUT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/sonarqube-coverage.xml"
CACHE FILEPATH "Output file for SonarQube XML coverage files")
option(LAMBDA_TUPLE_ENABLE_DYNAMIC_ANALYSIS "Compile tests with -fsanitize=undefined,address or /fsanitize=address" off)
set(LAMBDA_TUPLE_PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}")
if(LAMBDA_TUPLE_BUILD_TESTS)
message(STATUS "CMake version: ${CMAKE_VERSION}")
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
# include CMake modules
include("${CMAKE_CURRENT_LIST_DIR}/cmake/LambdaTupleCompileOptions.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/LambdaTupleInstallGitHooks.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/LambdaTupleCoverage.cmake")
endif()
add_subdirectory(src)
if(LAMBDA_TUPLE_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
if(LAMBDA_TUPLE_INSTALL)
include("${CMAKE_CURRENT_LIST_DIR}/cmake/LambdaTupleInstallation.cmake")
endif()