CMakeLists.txt 2.38 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
macro(add_fcl_test test_name)
  add_executable(${ARGV})
  target_link_libraries(${test_name}
    fcl
    ${Boost_SYSTEM_LIBRARY}
    ${Boost_THREAD_LIBRARY}
    ${Boost_DATE_TIME_LIBRARY}
    ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
  add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
endmacro(add_fcl_test)

# configure location of resources
13
14
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/fcl_resources" TEST_RESOURCES_SRC_DIR)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/fcl_resources" TEST_RESOURCES_BIN_DIR)
15
16
if(WIN32)
    # Correct directory separator for Windows
17
18
    string(REPLACE "\\" "\\\\" TEST_RESOURCES_SRC_DIR ${TEST_RESOURCES_SRC_DIR})
    string(REPLACE "\\" "\\\\" TEST_RESOURCES_BIN_DIR ${TEST_RESOURCES_BIN_DIR})
19
endif(WIN32)
20
configure_file("${TEST_RESOURCES_SRC_DIR}/config.h.in" "${TEST_RESOURCES_BIN_DIR}/config.h")
21
22

include_directories(.)
23
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
24
25
26
27
28
29
30
31
32

add_fcl_test(test_fcl_collision test_fcl_collision.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_distance test_fcl_distance.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_geometric_shapes test_fcl_geometric_shapes.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_broadphase test_fcl_broadphase.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_shape_mesh_consistency test_fcl_shape_mesh_consistency.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_frontlist test_fcl_frontlist.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_math test_fcl_math.cpp test_fcl_utility.cpp)

33
add_fcl_test(test_fcl_sphere_capsule test_fcl_sphere_capsule.cpp)
34
add_fcl_test(test_fcl_capsule_capsule test_fcl_capsule_capsule.cpp)
35
add_fcl_test(test_fcl_simple test_fcl_simple.cpp)
36
37
add_fcl_test(test_fcl_capsule_box_1 test_fcl_capsule_box_1.cpp)
add_fcl_test(test_fcl_capsule_box_2 test_fcl_capsule_box_2.cpp)
38
#add_fcl_test(test_fcl_global_penetration test_fcl_global_penetration.cpp libsvm/svm.cpp test_fcl_utility.cpp)
39

40
41
42
if (FCL_HAVE_OCTOMAP)
  add_fcl_test(test_fcl_octomap test_fcl_octomap.cpp test_fcl_utility.cpp)
endif()
panjia1983's avatar
panjia1983 committed
43

44
45
46
47
48
49
50
51
52
53
54
#if (FCL_HAVE_TINYXML)
#  add_executable(test_fcl_xmldata test_fcl_xmldata.cpp test_fcl_utility.cpp libsvm/svm.cpp)
#  target_link_libraries(test_fcl_xmldata
#    fcl
#    ${TINYXML_LIBRARY_DIRS}
#    ${Boost_SYSTEM_LIBRARY}
#    ${Boost_THREAD_LIBRARY}
#    ${Boost_DATE_TIME_LIBRARY}
#    ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
#  add_test(test_fcl_xmldata ${EXECUTABLE_OUTPUT_PATH}/test_fcl_xmldata)
#endif()