-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
73 lines (63 loc) · 3.7 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
##======================================================================================================================
## SPY - C++ Informations Broker
## Copyright : SPY Project Contributors
## SPDX-License-Identifier: BSL-1.0
##======================================================================================================================
cmake_minimum_required(VERSION 3.22)
project(spy LANGUAGES CXX)
##======================================================================================================================
option( SPY_BUILD_TEST "Build tests for SPY" ON )
option( SPY_BUILD_DOCUMENTATION "Build Doxygen for SPY" OFF )
##======================================================================================================================
include(${PROJECT_SOURCE_DIR}/cmake/dependencies.cmake)
if(SPY_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 1 MINOR 1 PATCH 0)
##======================================================================================================================
## Summary Display
##======================================================================================================================
if(NOT SPY_QUIET)
if(CMAKE_BUILD_TYPE)
message(STATUS "[${PROJECT_NAME}] - Building in ${CMAKE_BUILD_TYPE} mode")
endif()
message(STATUS "[${PROJECT_NAME}] - Unit tests : ${SPY_BUILD_TEST} (via SPY_BUILD_TEST)")
message(STATUS "[${PROJECT_NAME}] - Doxygen : ${SPY_BUILD_DOCUMENTATION} (via SPY_BUILD_DOCUMENTATION)")
set(QUIET_OPTION "")
else()
set(QUIET_OPTION "QUIET")
endif()
##======================================================================================================================
## Install Process setup
##======================================================================================================================
copa_setup_install( LIBRARY spy
FEATURES cxx_std_17
DOC ${PROJECT_SOURCE_DIR}/LICENSE.md
INCLUDE ${PROJECT_SOURCE_DIR}/include/spy
)
##======================================================================================================================
## Setup doxygen
##======================================================================================================================
if(SPY_BUILD_DOCUMENTATION)
copa_setup_doxygen(${QUIET_OPTION} TARGET spy-doxygen DESTINATION "${PROJECT_BINARY_DIR}/doc")
endif()
##======================================================================================================================
## Standalone generation
##======================================================================================================================
copa_setup_standalone ( QUIET
FILE spy.hpp SOURCE include DESTINATION standalone
ROOT spy TARGET spy-standalone
)
##======================================================================================================================
## Tests setup
##======================================================================================================================
if(SPY_BUILD_TEST)
enable_testing()
add_custom_target(spy-unit)
add_subdirectory(test)
endif()