Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update VHACD to latest (v4.1, tag 454913f) #896

Merged
merged 7 commits into from
Jun 8, 2023
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
10 changes: 0 additions & 10 deletions tesseract_collision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,6 @@ if(TESSERACT_PACKAGE)
list(APPEND LINUX_DEPENDS "fcl (>= 0.6.0) | ${TESSERACT_PACKAGE_PREFIX}fcl")
endif()

if(TESSERACT_BUILD_VHACD)
list(APPEND LINUX_DEPENDS "libomp-dev")
list(APPEND WINDOWS_DEPENDS "omp")

if(OpenCL_FOUND)
list(APPEND LINUX_DEPENDS "ocl-icd-opencl-dev")
list(APPEND WINDOWS_DEPENDS "ocl-icd-opencl")
endif()
endif()

tesseract_cpack(
VERSION ${pkg_extracted_version}
MAINTAINER <https://github.com/ros-industrial-consortium/tesseract>
Expand Down
22 changes: 0 additions & 22 deletions tesseract_collision/cmake/vhacd_common.cmake

This file was deleted.

1 change: 0 additions & 1 deletion tesseract_collision/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<depend>fcl</depend>
<depend>libconsole-bridge-dev</depend>
<depend>tesseract_support</depend>
<depend>libomp-dev</depend>

<build_depend>libboost-system-dev</build_depend>
<build_export_depend>libboost-system-dev</build_export_depend>
Expand Down
58 changes: 4 additions & 54 deletions tesseract_collision/vhacd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,18 @@
find_bullet()

# Third party vhacd
include("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/vhacd_common.cmake")

find_package(OpenMP REQUIRED)

option(NO_OPENCL "NO_OPENCL" OFF)
message("NO_OPENCL " ${NO_OPENCL})

if(NOT NO_OPENCL)
find_package(OpenCL)
endif()

if(NOT TARGET OpenMP::OpenMP_CXX)
find_package(Threads REQUIRED)
add_library(OpenMP::OpenMP_CXX IMPORTED INTERFACE)
set_property(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS})
# Only works if the same flag is passed to the linker; use CMake 3.9+ otherwise (Intel, AppleClang)
set_property(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads)
endif()

add_library(
${PROJECT_NAME}_vhacd
${VHACD_CPP_FILES}
${VHACD_C_FILES}
${VHACD_INC_FILES}
${VHACD_INL_FILES}
${VHACD_CL_FILES})
target_cxx_version(${PROJECT_NAME}_vhacd PUBLIC VERSION ${TESSERACT_CXX_VERSION})
target_compile_options(${PROJECT_NAME}_vhacd PRIVATE ${TESSERACT_COMPILE_OPTIONS_PRIVATE})
target_compile_options(${PROJECT_NAME}_vhacd PUBLIC ${TESSERACT_COMPILE_OPTIONS_PUBLIC})
target_compile_definitions(${PROJECT_NAME}_vhacd PUBLIC ${TESSERACT_COMPILE_DEFINITIONS})

if(OpenCL_FOUND)
target_include_directories(${PROJECT_NAME}_vhacd PRIVATE "${OpenCL_INCLUDE_DIR}")
target_link_libraries(${PROJECT_NAME}_vhacd PRIVATE "${OpenCL_LIBRARY}")
target_compile_definitions(${PROJECT_NAME}_vhacd PRIVATE -DOPENCL_FOUND=1)
target_compile_definitions(${PROJECT_NAME}_vhacd PRIVATE -DOPENCL_CL_FILES="${PROJECT_CL_FILES}")
endif()

target_link_libraries(
${PROJECT_NAME}_vhacd
PUBLIC OpenMP::OpenMP_CXX
tesseract::tesseract_common
Eigen3::Eigen
Bullet3::Bullet)
target_include_directories(${PROJECT_NAME}_vhacd PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

# Convex decomposition libraries
# Convex decomposition library
add_library(${PROJECT_NAME}_vhacd_convex_decomposition src/convex_decomposition_vhacd.cpp)
target_link_libraries(
${PROJECT_NAME}_vhacd_convex_decomposition
PUBLIC ${PROJECT_NAME}_core
${PROJECT_NAME}_bullet
${PROJECT_NAME}_vhacd
Eigen3::Eigen
tesseract::tesseract_geometry
console_bridge::console_bridge)
target_compile_options(${PROJECT_NAME}_vhacd_convex_decomposition PRIVATE ${TESSERACT_COMPILE_OPTIONS_PRIVATE})
target_compile_options(${PROJECT_NAME}_vhacd_convex_decomposition PUBLIC ${TESSERACT_COMPILE_OPTIONS_PUBLIC})
target_compile_definitions(${PROJECT_NAME}_vhacd_convex_decomposition PUBLIC ${TESSERACT_COMPILE_DEFINITIONS})
target_cxx_version(${PROJECT_NAME}_vhacd_convex_decomposition PUBLIC VERSION ${TESSERACT_CXX_VERSION})
target_clang_tidy(${PROJECT_NAME}_vhacd_convex_decomposition ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
# target_clang_tidy(${PROJECT_NAME}_vhacd_convex_decomposition ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})

target_code_coverage(
${PROJECT_NAME}_vhacd_convex_decomposition
PRIVATE
Expand All @@ -83,4 +33,4 @@ install(
PATTERN "*.inl"
PATTERN ".svn" EXCLUDE)

install_targets(TARGETS ${PROJECT_NAME}_vhacd ${PROJECT_NAME}_vhacd_convex_decomposition)
install_targets(TARGETS ${PROJECT_NAME}_vhacd_convex_decomposition)
Loading