-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
72 lines (63 loc) · 3.72 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
##======================================================================================================================
## KUMI - Compact C++20 Tuple Toolbox
## Copyright : KUMI Project Contributors
## SPDX-License-Identifier: BSL-1.0
##======================================================================================================================
cmake_minimum_required(VERSION 3.22)
project(kumi LANGUAGES CXX)
##======================================================================================================================
option( KUMI_BUILD_TEST "Build tests for Kumi" ON )
option( KUMI_BUILD_DOCUMENTATION "Build Doxygen for Kumi" OFF )
##======================================================================================================================
include(${PROJECT_SOURCE_DIR}/cmake/dependencies.cmake)
if(KUMI_BUILD_TEST)
include(${PROJECT_SOURCE_DIR}/cmake/compiler.cmake)
endif()
##======================================================================================================================
## Project setup via copacabana
##======================================================================================================================
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ${COPACABANA_SOURCE_DIR}/copacabana/cmake)
include(${COPACABANA_SOURCE_DIR}/copacabana/cmake/copacabana.cmake)
copa_project_version(MAJOR 3 MINOR 1 PATCH 0)
##======================================================================================================================
## Summary Display
##======================================================================================================================
if(NOT KUMI_QUIET)
if(CMAKE_BUILD_TYPE)
message(STATUS "[${PROJECT_NAME}] - Building in ${CMAKE_BUILD_TYPE} mode")
endif()
message(STATUS "[${PROJECT_NAME}] - Unit tests : ${KUMI_BUILD_TEST} (via KUMI_BUILD_TEST)")
message(STATUS "[${PROJECT_NAME}] - Doxygen : ${KUMI_BUILD_DOCUMENTATION} (via KUMI_BUILD_DOCUMENTATION)")
set(QUIET_OPTION "")
else()
set(QUIET_OPTION "QUIET")
endif()
##======================================================================================================================
## Install Process setup
##======================================================================================================================
copa_setup_install( LIBRARY kumi
FEATURES cxx_std_20
DOC ${PROJECT_SOURCE_DIR}/LICENSE.md
INCLUDE ${PROJECT_SOURCE_DIR}/include/kumi
)
##======================================================================================================================
## Setup doxygen
##======================================================================================================================
if(KUMI_BUILD_DOCUMENTATION)
copa_setup_doxygen(${QUIET_OPTION} TARGET kumi-doxygen DESTINATION "${PROJECT_BINARY_DIR}/doc")
endif()
##======================================================================================================================
## Standalone generation
##======================================================================================================================
copa_setup_standalone ( QUIET
FILE tuple.hpp SOURCE include DESTINATION standalone
ROOT kumi TARGET kumi-standalone
)
##======================================================================================================================
## Tests setup
##======================================================================================================================
if(KUMI_BUILD_TEST)
enable_testing()
add_custom_target(kumi-unit)
add_subdirectory(test)
endif()