-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
59 lines (50 loc) · 1.36 KB
/
Copy pathCMakeLists.txt
File metadata and controls
59 lines (50 loc) · 1.36 KB
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
cmake_minimum_required(VERSION 3.8)
option(PIPEABLE_BUILD_TESTS "Build tests" ON)
project(pipeable CXX)
add_library( ${PROJECT_NAME} INTERFACE)
add_library(fho::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories( ${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
INTERFACE $<INSTALL_INTERFACE:include>
)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
# ----------- INSTALL & EXPORT -----------
include(GNUInstallDirs)
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
)
install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}-config.cmake
NAMESPACE ${CMAKE_PROJECT_NAME}::
DESTINATION lib/cmake/${PROJECT_NAME}
)
export(
TARGETS ${PROJECT_NAME}
FILE ${PROJECT_NAME}-config.cmake
)
if(PIPEABLE_BUILD_TESTS)
find_package(Threads REQUIRED)
enable_testing()
add_subdirectory(catch2)
add_executable( pipeable_tests
"tests/pipeable_tests.cpp"
"tests/data_source_tests.cpp"
"tests/data_generator_tests.cpp"
"tests/guarded_data_generator_tests.cpp"
)
target_link_libraries( pipeable_tests
pipeable
catch2
Threads::Threads
)
add_test(
NAME pipeable_tests
COMMAND pipeable_tests
)
endif()