-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
57 lines (43 loc) · 1.08 KB
/
Copy pathCMakeLists.txt
File metadata and controls
57 lines (43 loc) · 1.08 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
cmake_minimum_required(VERSION 3.20)
project(ro-crate-cpp LANGUAGES CXX)
include(CTest)
add_library(ro-crate-cpp INTERFACE)
target_include_directories(ro-crate-cpp
INTERFACE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/vendor
)
target_compile_features(ro-crate-cpp INTERFACE cxx_std_20)
add_executable(example
tests/example.cpp
)
target_link_libraries(example
PRIVATE
ro-crate-cpp
)
if(BUILD_TESTING)
find_package(Catch2 3 REQUIRED)
add_executable(ro-crate-cpp_tests
tests/integration.cpp
tests/unit.cpp
)
target_link_libraries(ro-crate-cpp_tests
PRIVATE
ro-crate-cpp
Catch2::Catch2WithMain
)
target_compile_definitions(ro-crate-cpp_tests
PRIVATE
TEST_SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"
)
include(Catch)
catch_discover_tests(ro-crate-cpp_tests)
add_test(
NAME example
COMMAND example
)
set_tests_properties(example
PROPERTIES
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif()