-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
64 lines (57 loc) · 3.47 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
##======================================================================================================================
## TTS - Tiny Test System
## Copyright : TTS Contributors & Maintainers
## SPDX-License-Identifier: BSL-1.0
##======================================================================================================================
cmake_minimum_required(VERSION 3.22)
project(tts LANGUAGES CXX)
include(${PROJECT_SOURCE_DIR}/cmake/dependencies.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/compiler.cmake)
##======================================================================================================================
option( TTS_BUILD_TEST "Build tests for TTS" ON )
option( TTS_BUILD_DOCUMENTATION "Build Doxygen for TTS" OFF )
##======================================================================================================================
## 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 2 MINOR 3 PATCH 0)
##======================================================================================================================
## Summary Display
##======================================================================================================================
if(NOT TTS_QUIET)
if(CMAKE_BUILD_TYPE)
message(STATUS "[${PROJECT_NAME}] - Building in ${CMAKE_BUILD_TYPE} mode")
endif()
message(STATUS "[${PROJECT_NAME}] - Unit tests : ${TTS_BUILD_TEST} (via TTS_BUILD_TEST)")
message(STATUS "[${PROJECT_NAME}] - Doxygen : ${TTS_BUILD_DOCUMENTATION} (via TTS_BUILD_DOCUMENTATION)")
set(QUIET_OPTION "")
else()
set(QUIET_OPTION "QUIET")
endif()
##======================================================================================================================
## Install Process setup
##======================================================================================================================
copa_setup_install( LIBRARY tts
FEATURES cxx_std_20
DOC ${PROJECT_SOURCE_DIR}/LICENSE.md
INCLUDE ${PROJECT_SOURCE_DIR}/include/tts
)
##======================================================================================================================
## Standalone generation
##======================================================================================================================
copa_setup_standalone(${QUIET_OPTION} FILE tts.hpp SOURCE include DESTINATION standalone ROOT tts TARGET tts-standalone)
##======================================================================================================================
## Setup doxygen
##======================================================================================================================
if(TTS_BUILD_DOCUMENTATION)
copa_setup_doxygen(${QUIET_OPTION} TARGET tts-doxygen DESTINATION "${PROJECT_BINARY_DIR}/doc")
endif()
##======================================================================================================================
## Tests setup
##======================================================================================================================
if(TTS_BUILD_TEST)
enable_testing()
add_custom_target(tts-unit)
add_subdirectory(test)
endif()