forked from johnmcfarlane/cnl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
43 lines (33 loc) · 1.06 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
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
project(cnl VERSION 0.0.1)
cmake_minimum_required(VERSION 3.7.2)
set(CNL_DEV OFF CACHE BOOL "configure build for running tests and benchmarks")
if (CNL_DEV)
# runs a suite of compile-time tests using `static_assert`
# and run-time tests using gtest
include(CTest)
add_subdirectory("src/test")
# performs a selection of benchmark tests using googletest
add_subdirectory("src/benchmark")
# generate documentation
add_subdirectory("doc")
# generate single-header header
add_subdirectory("src/single_header")
endif (CNL_DEV)
# the CNL library
add_library(Cnl INTERFACE)
target_include_directories(
Cnl INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
install(TARGETS Cnl EXPORT CnlTargets)
install(DIRECTORY include/ DESTINATION include)
install(EXPORT CnlTargets
FILE CnlConfig.cmake
NAMESPACE Cnl::
DESTINATION lib/cmake/cnl)