-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
76 lines (65 loc) · 3.38 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
74
75
76
##==================================================================================================
## KIWAKU - Containers Well Made
## Copyright : KIWAKU Contributors & Maintainers
## SPDX-License-Identifier: BSL-1.0
##==================================================================================================
cmake_minimum_required(VERSION 3.18)
enable_testing()
## =================================================================================================
## Setup project
## =================================================================================================
project(kiwaku LANGUAGES CXX)
set(KIWAKU_MAJOR_VERSION 0)
set(KIWAKU_MINOR_VERSION 1)
set(KIWAKU_PATCH_VERSION 0)
set(KIWAKU_VERSION ${KIWAKU_MAJOR_VERSION}.${KIWAKU_MINOR_VERSION}.${KIWAKU_PATCH_VERSION})
set(PROJECT_VERSION ${KIWAKU_VERSION})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake )
##==================================================================================================
## Prevent in-source build
##==================================================================================================
if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
message( FATAL_ERROR "[kiwaku] Building in-source, not recommended! Build in a separate directory." )
endif()
## =================================================================================================
## Exporting target for external use
## =================================================================================================
include(kiwaku-install)
##==================================================================================================
## Options
##==================================================================================================
option( KIWAKU_BUILD_TEST "Build tests for Kiwaku" ON )
option( KIWAKU_BUILD_INTEGRATION "Build integration tests for Kiwaku" OFF )
option( KIWAKU_BUILD_DOCUMENTATION "Build docs for Kiwaku" OFF )
##==================================================================================================
## Setup Testing
##==================================================================================================
if( KIWAKU_BUILD_TEST )
enable_testing()
include(CTest)
add_custom_target(unit)
add_subdirectory(test)
endif()
if( KIWAKU_BUILD_INTEGRATION )
add_subdirectory("${PROJECT_SOURCE_DIR}/test/integration")
endif()
##==================================================================================================
## Add Doxygen building target
##==================================================================================================
if(KIWAKU_BUILD_DOCUMENTATION)
find_package(Doxygen QUIET)
if (DOXYGEN_FOUND)
message( STATUS "[kiwaku] Doxygen available")
else (DOXYGEN_FOUND)
message( STATUS "[kiwaku] Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
if (DOXYGEN_FOUND)
set(DOXYGEN_CONFIG ${PROJECT_SOURCE_DIR}/doc/Doxyfile)
add_custom_target ( doxygen
COMMAND KWK_DOXYGEN_OUPUT=${PROJECT_BINARY_DIR}/docs ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/doc
COMMENT "[kiwaku] Generating API documentation with Doxygen - Local version"
VERBATIM
)
endif (DOXYGEN_FOUND)
endif()