Skip to content
Open
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
22 changes: 20 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,26 @@ elseif(NOT HOST_IS_WSL AND WIN32)
message("-- Use WinToast for notifications")
endif()

# qhull (build re-entrant static version)
add_subdirectory(3rd-party/qhull)
find_package(
Qhull
COMPONENTS qhullcpp qhullstatic_r
QUIET
)
message(STATUS "Using system Qhull")
if(Qhull_FOUND)
set(QHULL_TARGETS Qhull::qhullcpp Qhull::qhullstatic_r)
else()
message(STATUS "Using bundled Qhull (re-entrant static version)")
# qhull (build re-entrant static version)
add_subdirectory(3rd-party/qhull)
# Alias bundled targets to Qhull:: namespace if not already present
if(NOT TARGET Qhull::qhullcpp)
add_library(Qhull::qhullcpp ALIAS qhullcpp)
endif()
if(NOT TARGET Qhull::qhullstatic_r)
add_library(Qhull::qhullstatic_r ALIAS qhullstatic_r)
endif()
endif()

# mpack (build static version)
add_subdirectory(3rd-party/mpack)
Expand Down
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ target_compile_definitions(mc_rbdyn PUBLIC -DUSE_UNSTABLE_GEOS_CPP_API)
# qhull
if(MC_RTC_BUILD_STATIC)
target_link_libraries(
mc_rbdyn PRIVATE "-Wl,--no-whole-archive" qhullstatic_r "-Wl,--no-whole-archive"
qhullcpp
mc_rbdyn PRIVATE "-Wl,--no-whole-archive" Qhull::qhullstatic_r
"-Wl,--no-whole-archive" Qhull::qhullcpp
)
else()
target_link_libraries(mc_rbdyn PRIVATE qhullstatic_r qhullcpp)
target_link_libraries(mc_rbdyn PRIVATE Qhull::qhullstatic_r Qhull::qhullcpp)
endif()

if(TARGET mc_rtc_3rd_party::ROS)
Expand Down
Loading