-
Notifications
You must be signed in to change notification settings - Fork 73
/
CMakeLists.txt
107 lines (93 loc) · 4.55 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# ============================================================================
# Copyright (c) 2015 <provider-name>
# All rights reserved.
#
# See COPYING file for license information.
# ============================================================================
##############################################################################
# @file CMakeLists.txt
# @brief Build configuration of software testing.
#
# Unit tests test only single functions, classes, and modules of the software.
# System tests, on the other side, execute the programs of this package with
# given test input data and compare the output of the programs to the expected
# results. For the definition of system tests which perform image regression
# tests, i.e., compare the images written by the test to given baseline images,
# the basis.testdriver executable target imported from BASIS can be used to
# execute the executable to test and perform the regression tests.
#
# Example:
# @code
# basis_add_test (
# COMMAND basis.testdriver -v
# --intensity-tolerance 2
# --compare "t1_bc.nii.gz"
# "${PROJECT_TESTING_DIR}/baseline/t1_bc.nii.gz"
# --
# $<TARGET_FILE:biascorrect>
# "${PROJECT_TESTING_DIR}/input/t1.nii.gz"
# t1_bc.nii.gz
# )
# @endcode
#
# If the tests are implemented in C/C++ as supported by CMake's
# create_test_sourcelist() function, a custom test driver can be generated
# using the basis_add_test_driver() function and this test driver then be used
# to execute the tests and perform the regression tests.
#
# Example:
# @code
# basis_add_test_driver (testdriver test1.cxx test2.cxx test3.cxx)
#
# basis_add_test (
# COMMAND testdriver -v
# --intensity-tolerance 2
# --compare "t1_bc.nii.gz"
# "${PROJECT_TESTING_DIR}/baseline/t1_bc.nii.gz"
# --
# biascorrect # test1.cxx defines int biascorrect(int argc, char* argv[])
# "${PROJECT_TESTING_DIR}/input/t1.nii.gz"
# t1_bc.nii.gz
# )
#
# # ...
# @endcomsg->#
# @sa http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:create_test_sourcelist
#
# The built test executables can be found in @c TESTING_RUNTIME_DIR.
# The test output shall be written to @c TESTING_OUTPUT_DIR. In most cases,
# a subdirectory for each test should be created under this output directory.
# Therefore, the basis_add_test() function creates such subdirectory and sets
# the working directory of the test to this output directory.
##############################################################################
# ============================================================================
# internal tests
# ============================================================================
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/internal")
add_subdirectory ("internal")
endif ()
# ============================================================================
# public tests
# ============================================================================
# For KUKA IIWA FRI Libraries
if(TARGET KukaFRIClient OR FRI_Client_SDK_Cpp_FOUND)
basis_include_directories(${FRI_Client_SDK_Cpp_PROJECT_INCLUDE_DIRS} ${Boost_REGEX_LIBRARY} ${FRI_Client_SDK_Cpp_INCLUDE_DIRS} ${PROJECT_INCLUDE_DIR}/thirdparty/vrep/include)
basis_add_executable(KukaFRITest.cpp)# ${GRL_FLATBUFFERS_OUTPUTS})
basis_target_link_libraries(KukaFRITest ${Boost_LIBRARIES} ${Boost_REGEX_LIBRARY} ${FRI_Client_SDK_Cpp_LIBRARIES} ${Nanopb_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} KukaFRIClient)
if(UNIX AND NOT APPLE)
set(LINUX_ONLY_LIBS ${LIBDL_LIBRARIES})
endif()
basis_add_test(KukaLBRiiwaVrepPluginTest.cpp)
basis_target_link_libraries(KukaLBRiiwaVrepPluginTest ${Boost_LIBRARIES} ${Boost_REGEX_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${FRI_Client_SDK_Cpp_LIBRARIES} ${Nanopb_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
v_repLib KukaFRIClient ${LINUX_ONLY_LIBS} )
endif()
if(CERES_FOUND OR USE_INTERNAL_CERES)
basis_include_directories(${PROJECT_INCLUDE_DIR}/thirdparty/vrep/include ${PROJECT_INCLUDE_DIR}/thirdparty/camodocal/include ${EIGEN3_INCLUDE_DIR})
basis_add_test(HandEyeCalibration_test.cpp)
basis_target_link_libraries(HandEyeCalibration_test ${Boost_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} v_repExtHandEyeCalibration)
endif()
if(FUSIONTRACK_FOUND)
basis_include_directories(${GRL_INCLUDE_DIRS}/thirdparty/vrep/include ${FUSIONTRACK_INCLUDE_DIRS} ${grl_INCLUDE_DIRS}/thirdparty/vrep/include)
basis_add_executable(fusionTrackTest.cpp)
basis_target_link_libraries(fusionTrackTest ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${FUSIONTRACK_LIBRARIES} v_repLib)
endif()