Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ find_package(resource_retriever REQUIRED)
find_package(shape_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(fcl REQUIRED)
include(ConfigExtras)

set(THIS_PACKAGE_EXPORT_DEPENDS
eigen3_cmake_module
Expand Down Expand Up @@ -90,15 +89,25 @@ target_compile_options(${PROJECT_NAME} PRIVATE ${PROJECT_COMPILE_OPTIONS})
target_include_directories(${PROJECT_NAME}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
ament_target_dependencies(${PROJECT_NAME} PUBLIC
${THIS_PACKAGE_EXPORT_DEPENDS}
)
# Private libraries that are not transitively needed by downstream projects
target_link_libraries(${PROJECT_NAME} PRIVATE assimp::assimp fcl ${QHULL_LIBRARIES})
target_link_libraries(${PROJECT_NAME}
PRIVATE
assimp::assimp
fcl
${QHULL_LIBRARIES}
PUBLIC
${geometry_msgs_TARGETS}
${shape_msgs_TARGETS}
${visualization_msgs_TARGETS}
${console_bridge_TARGETS}
eigen_stl_containers::eigen_stl_containers
random_numbers::random_numbers
rclcpp::rclcpp
resource_retriever::resource_retriever
)
target_include_directories(${PROJECT_NAME} PRIVATE ${QHULL_INCLUDE_DIRS})

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
# Unit tests
add_subdirectory(test)

Expand All @@ -120,4 +129,4 @@ install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_EXPORT_DEPENDS})

ament_package(CONFIG_EXTRAS "cmake/ConfigExtras.cmake")
ament_package()
31 changes: 0 additions & 31 deletions cmake/ConfigExtras.cmake

This file was deleted.

14 changes: 8 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(ament_cmake_gtest REQUIRED)

file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/resources" TEST_RESOURCES_DIR)
if(WIN32)
# Correct directory separator for Windows
Expand All @@ -8,13 +11,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})

ament_add_gtest(test_basics test_basics.cpp)
target_link_libraries(test_basics ${PROJECT_NAME})
ament_target_dependencies(test_basics Eigen3)

ament_add_gtest(test_point_inclusion test_point_inclusion.cpp)
target_link_libraries(test_point_inclusion ${PROJECT_NAME})
target_link_libraries(test_point_inclusion ${PROJECT_NAME} Boost::filesystem)

ament_add_gtest(test_bounding_sphere test_bounding_sphere.cpp)
target_link_libraries(test_bounding_sphere ${PROJECT_NAME})
target_link_libraries(test_bounding_sphere ${PROJECT_NAME} Boost::filesystem)

ament_add_gtest(test_bounding_box test_bounding_box.cpp)
target_link_libraries(test_bounding_box ${PROJECT_NAME})
Expand All @@ -26,13 +28,13 @@ ament_add_gtest(test_create_mesh test_create_mesh.cpp)
target_link_libraries(test_create_mesh ${PROJECT_NAME})

ament_add_gtest(test_loaded_meshes test_loaded_meshes.cpp)
target_link_libraries(test_loaded_meshes ${PROJECT_NAME})
target_link_libraries(test_loaded_meshes ${PROJECT_NAME} Boost::filesystem)

ament_add_gtest(test_shapes test_shapes.cpp)
target_link_libraries(test_shapes ${PROJECT_NAME})

ament_add_gtest(test_ray_intersection test_ray_intersection.cpp)
target_link_libraries(test_ray_intersection ${PROJECT_NAME})
target_link_libraries(test_ray_intersection ${PROJECT_NAME} Boost::filesystem)

ament_add_gtest(test_body_operations test_body_operations.cpp)
target_link_libraries(test_body_operations ${PROJECT_NAME})
target_link_libraries(test_body_operations ${PROJECT_NAME} Boost::filesystem)
Loading