diff --git a/CMakeLists.txt b/CMakeLists.txt index a1d9bb5..bf64c46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -359,10 +359,8 @@ if(WITH_QHULL) if(NOT PCL_SHARED_LIBS OR ((WIN32 AND NOT MINGW) AND NOT PCL_BUILD_WITH_QHULL_DYNAMIC_LINKING_WIN32)) set(QHULL_USE_STATIC ON) endif() - find_package(Qhull) - if(QHULL_FOUND) - include_directories(SYSTEM ${QHULL_INCLUDE_DIRS}) - endif() + find_package(QHULL NAMES Qhull CONFIG REQUIRED) + set(HAVE_QHULL ON) endif() # Cuda diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in index a1283a8..32f95b3 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in @@ -26,6 +26,7 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules") +include(CMakeFindDependencyMacro) ### ---[ some useful macros macro(pcl_report_not_found _reason) unset(PCL_FOUND) @@ -136,7 +137,7 @@ macro(find_qhull) endif() set(QHULL_USE_STATIC @QHULL_USE_STATIC@) - find_package(Qhull) + find_dependency(QHULL NAMES Qhull CONFIG) endmacro() #remove this as soon as libopenni is shipped with FindOpenni.cmake diff --git a/surface/CMakeLists.txt b/surface/CMakeLists.txt index d8a8566..a629b2a 100644 --- a/surface/CMakeLists.txt +++ b/surface/CMakeLists.txt @@ -187,6 +187,11 @@ if(VTK_FOUND) endif() if(QHULL_FOUND) + if(QHULL_USE_STATIC) + set(QHULL_LIBRARIES Qhull::qhullcpp Qhull::qhullstatic Qhull::qhullstatic_r) + else() + set(QHULL_LIBRARIES Qhull::qhull_r Qhull::qhullcpp) + endif() target_link_libraries("${LIB_NAME}" ${QHULL_LIBRARIES}) endif()