CMakeLists.txt 2.08 KB
Newer Older
1
2
config_files(fcl_resources/config.h)

3
4
macro(add_fcl_test test_name source)
  ADD_UNIT_TEST(${test_name} ${source})
5
  target_link_libraries(${test_name}
6
    PUBLIC
7
    hpp-fcl
8
    ${Boost_LIBRARIES}
9
    Boost::unit_test_framework
10
    utility
11
    )
12
  PKG_CONFIG_USE_DEPENDENCY(${test_name} assimp)
13
  target_compile_options(${test_name} PRIVATE "-Wno-c99-extensions")
14
15
16
  if(HPP_FCL_HAS_QHULL)
    target_compile_options(${test_name} PRIVATE -DHPP_FCL_HAS_QHULL)
  endif()
17
18
endmacro(add_fcl_test)

19
include_directories(${CMAKE_CURRENT_BINARY_DIR})
20

21
IF(BUILD_TESTING)
22
23
24
25
  add_library(utility STATIC utility.cpp)
ELSE()
  add_library(utility STATIC EXCLUDE_FROM_ALL utility.cpp)
ENDIF()
26
target_link_libraries(utility PUBLIC ${PROJECT_NAME})
27

28
29
add_fcl_test(math math.cpp)

30
31
32
33
34
35
36
add_fcl_test(collision collision.cpp)
add_fcl_test(distance distance.cpp)
add_fcl_test(distance_lower_bound distance_lower_bound.cpp)
add_fcl_test(geometric_shapes geometric_shapes.cpp)
#add_fcl_test(broadphase broadphase.cpp)
#add_fcl_test(shape_mesh_consistency shape_mesh_consistency.cpp)
add_fcl_test(frontlist frontlist.cpp)
37
SET_TESTS_PROPERTIES(frontlist PROPERTIES TIMEOUT 7200)
38
#add_fcl_test(math math.cpp)
39
40

# add_fcl_test(sphere_capsule sphere_capsule.cpp)
41
42
add_fcl_test(capsule_capsule capsule_capsule.cpp)
add_fcl_test(box_box_distance box_box_distance.cpp)
43
add_fcl_test(simple simple.cpp)
44
45
add_fcl_test(capsule_box_1 capsule_box_1.cpp)
add_fcl_test(capsule_box_2 capsule_box_2.cpp)
46
add_fcl_test(obb obb.cpp)
47
add_fcl_test(convex convex.cpp)
48

49
add_fcl_test(bvh_models bvh_models.cpp)
50

51
add_fcl_test(profiling profiling.cpp)
52
53
54
PKG_CONFIG_USE_DEPENDENCY(profiling assimp)

add_fcl_test(gjk gjk.cpp)
55
if(HPP_FCL_HAVE_OCTOMAP)
56
  add_fcl_test(octree octree.cpp)
57
endif(HPP_FCL_HAVE_OCTOMAP)
58

Joseph Mirabel's avatar
Joseph Mirabel committed
59
## Benchmark
60
61
62
63
64
IF(BUILD_TESTING)
  add_executable(test-benchmark benchmark.cpp)
ELSE()
  add_executable(test-benchmark EXCLUDE_FROM_ALL benchmark.cpp)
ENDIF()
65
66
67
68
69
70
71
target_link_libraries(test-benchmark 
  PUBLIC 
  utility
  Boost::chrono
  Boost::filesystem
  ${PROJECT_NAME} 
  )
Gabriele Buondonno's avatar
Gabriele Buondonno committed
72
73
74
75
76

## Python tests
IF(BUILD_PYTHON_INTERFACE)
  ADD_SUBDIRECTORY(python_unit)
ENDIF(BUILD_PYTHON_INTERFACE)