forked from OpenNavigationSurface/BAG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (74 loc) · 2.64 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
77
78
79
80
81
82
83
84
85
86
87
88
project(OpenNavSurf-BAG_Tests LANGUAGES CXX)
enable_testing()
# The debug build will have a 'd' postfix
set(CMAKE_DEBUG_POSTFIX "d")
set(TEST_SOURCE_FILES
test_main.cpp
test_bag_georefmetadata_layer.cpp
test_bag_compounddatatype.cpp
test_bag_dataset.cpp
test_bag_descriptor.cpp
test_bag_interleavedlegacylayer.cpp
test_bag_interleavedlegacylayerdescriptor.cpp
test_bag_metadata.cpp
test_bag_record.cpp
test_bag_simplelayer.cpp
test_bag_simplelayerdescriptor.cpp
test_bag_surfacecorrectionsdescriptor.cpp
test_bag_surfacecorrections.cpp
test_bag_trackinglist.cpp
test_bag_valuetable.cpp
test_utils.cpp
test_utils.h
test_bag_vrmetadata.cpp
test_bag_vrmetadatadescriptor.cpp
test_bag_vrnode.cpp
test_bag_vrnodedescriptor.cpp
test_bag_vrrefinements.cpp
test_bag_vrrefinementsdescriptor.cpp
test_bag_vrtrackinglist.cpp
)
source_group("Source Files" FILES ${TEST_SOURCE_FILES})
add_executable(bag_tests ${TEST_SOURCE_FILES})
set_target_properties(bag_tests
PROPERTIES
CMAKE_CXX_EXTENSIONS OFF
DEBUG_OUTPUT_NAME bag_tests_d
)
target_compile_definitions(bag_tests
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:_USE_MATH_DEFINES>
$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>
$<$<CXX_COMPILER_ID:MSVC>:_CRT_NONSTDC_NO_DEPRECATE>
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<BOOL:BAG_BUILD_SHARED_LIBS>>:BAG_DLL>
CATCH_CONFIG_FAST_COMPILE
CATCH_CONFIG_DISABLE_MATCHERS
CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
)
target_compile_options(bag_tests
PRIVATE
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,19.10>>:/permissive- /W4 /WX>
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,19.13>>:/experimental:external /external:W0 /external:templates->
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,19.13>>:/external:anglebrackets>
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,19.14>>:/Zc:__cplusplus>
)
find_package(HDF5 COMPONENTS CXX REQUIRED)
find_package(Catch2 3 REQUIRED)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20")
set(HDF5_PRIVATE HDF5::HDF5)
endif()
target_link_libraries(bag_tests
PRIVATE
baglib
Catch2::Catch2
${HDF5_PRIVATE}
)
target_include_directories(bag_tests
PRIVATE SYSTEM
${HDF5_INCLUDE_DIRS}
)
include(CTest)
include(Catch)
if(BAG_CODE_COVERAGE)
target_code_coverage(bag_tests AUTO ALL EXCLUDE tests/*)
endif()