From 1c65670dacde359571d7ec7dee539b2506cb4500 Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Thu, 18 Apr 2024 15:58:34 +0000 Subject: [PATCH] fixups --- 2d/CMakeLists.txt | 1 + apps/3d_rec_framework/CMakeLists.txt | 2 +- apps/CMakeLists.txt | 4 +- apps/cloud_composer/CMakeLists.txt | 4 +- apps/in_hand_scanner/CMakeLists.txt | 2 +- apps/modeler/CMakeLists.txt | 2 +- cmake/pcl_targets.cmake | 59 ++++++++++++++-------------- cuda/common/CMakeLists.txt | 1 + cuda/features/CMakeLists.txt | 2 +- cuda/io/CMakeLists.txt | 2 +- cuda/segmentation/CMakeLists.txt | 2 +- examples/geometry/CMakeLists.txt | 2 +- features/CMakeLists.txt | 2 +- segmentation/CMakeLists.txt | 2 +- test/io/CMakeLists.txt | 4 +- test/octree/CMakeLists.txt | 2 +- test/recognition/CMakeLists.txt | 2 +- test/registration/CMakeLists.txt | 4 +- visualization/CMakeLists.txt | 2 +- 19 files changed, 52 insertions(+), 49 deletions(-) diff --git a/2d/CMakeLists.txt b/2d/CMakeLists.txt index f2656b2f475..aa9d3f5b3aa 100644 --- a/2d/CMakeLists.txt +++ b/2d/CMakeLists.txt @@ -31,6 +31,7 @@ set(impl_incs set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME}) +target_link_libraries(${LIB_NAME} INTERFACE pcl_filters) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} HEADER_ONLY) #Install include files diff --git a/apps/3d_rec_framework/CMakeLists.txt b/apps/3d_rec_framework/CMakeLists.txt index 433b782ba29..a75d17047a1 100644 --- a/apps/3d_rec_framework/CMakeLists.txt +++ b/apps/3d_rec_framework/CMakeLists.txt @@ -89,7 +89,7 @@ PCL_ADD_INCLUDES("${SUBSUBSYS_NAME}" "${SUBSYS_NAME}/${SUBSUBSYS_NAME}/pipeline/ set(LIB_NAME "pcl_${SUBSUBSYS_NAME}") PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSUBSYS_NAME} SOURCES ${srcs} ${impl_incs_pipeline} ${incs_utils} ${incs_fw} ${incs_fw_global} ${incs_fw_local} ${incc_tools_framework} ${incs_pipelines} ${incs_pc_source}) -target_link_libraries("${LIB_NAME}" pcl_apps pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search pcl_registration) +target_link_libraries("${LIB_NAME}" pcl_apps pcl_common pcl_io pcl_filters pcl_keypoints pcl_recognition pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search pcl_registration) if(WITH_OPENNI) target_link_libraries("${LIB_NAME}" ${OPENNI_LIBRARIES}) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index e2522edf753..ebc870b4008 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -123,7 +123,7 @@ if(VTK_FOUND) src/pcd_video_player/pcd_video_player.ui BUNDLE) - target_link_libraries(pcl_pcd_video_player pcl_common pcl_io pcl_visualization pcl_segmentation pcl_features pcl_surface ${QTX}::Widgets) + target_link_libraries(pcl_pcd_video_player pcl_common pcl_io pcl_registration pcl_visualization pcl_segmentation pcl_features pcl_surface ${QTX}::Widgets) target_include_directories(pcl_pcd_video_player PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) endif() @@ -238,7 +238,7 @@ if(VTK_FOUND) target_link_libraries(pcl_ni_trajkovic pcl_apps pcl_common pcl_visualization pcl_features pcl_keypoints pcl_search) PCL_ADD_EXECUTABLE(pcl_openni_klt COMPONENT ${SUBSYS_NAME} SOURCES src/openni_klt.cpp BUNDLE) - target_link_libraries(pcl_openni_klt pcl_common pcl_io pcl_visualization pcl_tracking) + target_link_libraries(pcl_openni_klt pcl_common pcl_io pcl_keypoints pcl_visualization pcl_tracking) endif() # WITH_OPENNI endif() # VTK_FOUND diff --git a/apps/cloud_composer/CMakeLists.txt b/apps/cloud_composer/CMakeLists.txt index 083a0fb36e1..47668e169a4 100644 --- a/apps/cloud_composer/CMakeLists.txt +++ b/apps/cloud_composer/CMakeLists.txt @@ -5,7 +5,7 @@ set(SUBSUBSYS_NAME cloud_composer) set(SUBSUBSYS_DESC "Cloud Composer - Application for Manipulating Point Clouds") -set(SUBSUBSYS_DEPS common io visualization filters apps) +set(SUBSUBSYS_DEPS common io visualization features filters apps) set(SUBSUBSYS_EXT_DEPS vtk ${QTX}) set(REASON "") set(DEFAULT OFF) @@ -71,7 +71,7 @@ set(PCL_LIB_TYPE STATIC) PCL_ADD_LIBRARY(pcl_cc_tool_interface COMPONENT ${SUBSUBSYS_NAME} SOURCES ${INTERFACE_HEADERS} ${INTERFACE_SOURCES}) -target_link_libraries(pcl_cc_tool_interface pcl_common pcl_filters pcl_search pcl_visualization ${QTX}::Widgets) +target_link_libraries(pcl_cc_tool_interface pcl_common pcl_features pcl_filters pcl_search pcl_visualization ${QTX}::Widgets) set(PCL_LIB_TYPE ${PCL_LIB_TYPE_ORIGIN}) diff --git a/apps/in_hand_scanner/CMakeLists.txt b/apps/in_hand_scanner/CMakeLists.txt index ecc2c7fde02..865d8aa14dd 100644 --- a/apps/in_hand_scanner/CMakeLists.txt +++ b/apps/in_hand_scanner/CMakeLists.txt @@ -1,7 +1,7 @@ set(SUBSUBSYS_NAME in_hand_scanner) set(SUBSUBSYS_DESC "In-hand scanner for small objects") set(SUBSUBSYS_DEPS common features io kdtree apps) -set(SUBSUBSYS_LIBS pcl_common pcl_features pcl_io pcl_kdtree) +set(SUBSUBSYS_LIBS pcl_common pcl_geometry pcl_features pcl_io pcl_kdtree) set(SUBSUBSYS_EXT_DEPS ${QTX} OpenGL OpenGL_GLU openni) set(REASON "") set(DEFAULT OFF) diff --git a/apps/modeler/CMakeLists.txt b/apps/modeler/CMakeLists.txt index ced6c8adaab..f7d2bae150d 100644 --- a/apps/modeler/CMakeLists.txt +++ b/apps/modeler/CMakeLists.txt @@ -112,7 +112,7 @@ PCL_ADD_EXECUTABLE( ${incs} ${impl_incs}) -target_link_libraries("${EXE_NAME}" pcl_common pcl_io pcl_kdtree pcl_filters pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search ${QTX}::Widgets) +target_link_libraries("${EXE_NAME}" pcl_common pcl_io pcl_kdtree pcl_filters pcl_registration pcl_visualization pcl_segmentation pcl_surface pcl_features pcl_sample_consensus pcl_search ${QTX}::Widgets) target_include_directories(${EXE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) # Install include files diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake index 92bf0eb6ee2..a13dde419d9 100644 --- a/cmake/pcl_targets.cmake +++ b/cmake/pcl_targets.cmake @@ -118,8 +118,6 @@ macro(PCL_SUBSYS_DEPEND _var) if(NOT _status) set(${_var} FALSE) PCL_SET_SUBSYS_STATUS(${_name} FALSE "Requires ${_dep}.") - else() - PCL_GET_SUBSYS_INCLUDE_DIR(_include_dir ${_dep}) endif() endforeach() endif() @@ -133,12 +131,6 @@ macro(PCL_SUBSYS_DEPEND _var) endif() endforeach() endif() - if(ARGS_OPT_DEPS) - foreach(_dep ${ARGS_OPT_DEPS}) - PCL_GET_SUBSYS_INCLUDE_DIR(_include_dir ${_dep}) - include_directories(${PROJECT_SOURCE_DIR}/${_include_dir}/include) - endforeach() - endif() endif() endmacro() @@ -265,30 +257,39 @@ function(PCL_CUDA_ADD_LIBRARY _name) endif() REMOVE_VTK_DEFINITIONS() + if(NOT ARGS_SOURCES) + add_library(${_name} INTERFACE) + + target_include_directories(${_name} INTERFACE + $ + $ + ) - add_library(${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES}) - - PCL_ADD_VERSION_INFO(${_name}) - - target_compile_options(${_name} PRIVATE $<$: ${GEN_CODE} --expt-relaxed-constexpr>) - - target_include_directories(${_name} PUBLIC - $ - $ - ) - - target_include_directories(${_name} PRIVATE ${CUDA_TOOLKIT_INCLUDE}) - - if(MSVC) - target_link_libraries(${_name} delayimp.lib) # because delay load is enabled for openmp.dll + else() + add_library(${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES}) + + PCL_ADD_VERSION_INFO(${_name}) + + target_compile_options(${_name} PRIVATE $<$: ${GEN_CODE} --expt-relaxed-constexpr>) + + target_include_directories(${_name} PUBLIC + $ + $ + ) + + target_include_directories(${_name} PRIVATE ${CUDA_TOOLKIT_INCLUDE}) + + if(MSVC) + target_link_libraries(${_name} delayimp.lib) # because delay load is enabled for openmp.dll + endif() + + set_target_properties(${_name} PROPERTIES + VERSION ${PCL_VERSION} + SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR} + DEFINE_SYMBOL "PCLAPI_EXPORTS") + set_target_properties(${_name} PROPERTIES FOLDER "Libraries") endif() - set_target_properties(${_name} PROPERTIES - VERSION ${PCL_VERSION} - SOVERSION ${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR} - DEFINE_SYMBOL "PCLAPI_EXPORTS") - set_target_properties(${_name} PROPERTIES FOLDER "Libraries") - install(TARGETS ${_name} RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT pcl_${ARGS_COMPONENT} LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT pcl_${ARGS_COMPONENT} diff --git a/cuda/common/CMakeLists.txt b/cuda/common/CMakeLists.txt index 186f5b7212f..2524242b5da 100644 --- a/cuda/common/CMakeLists.txt +++ b/cuda/common/CMakeLists.txt @@ -28,6 +28,7 @@ set(common_incs ) set(LIB_NAME "pcl_${SUBSYS_NAME}") +PCL_CUDA_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME}) set(EXT_DEPS CUDA) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC "${SUBSYS_DESC}" PCL_DEPS "${SUBSYS_DEPS}" EXT_DEPS "" HEADER_ONLY) diff --git a/cuda/features/CMakeLists.txt b/cuda/features/CMakeLists.txt index 018a3058024..cc1bdfe283b 100644 --- a/cuda/features/CMakeLists.txt +++ b/cuda/features/CMakeLists.txt @@ -24,7 +24,7 @@ set(incs set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_CUDA_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs}) -target_link_libraries(${LIB_NAME} pcl_common) +target_link_libraries(${LIB_NAME} pcl_common pcl_io pcl_cuda_common) set(EXT_DEPS "") #set(EXT_DEPS CUDA) diff --git a/cuda/io/CMakeLists.txt b/cuda/io/CMakeLists.txt index 3c25360ac2c..da893951105 100644 --- a/cuda/io/CMakeLists.txt +++ b/cuda/io/CMakeLists.txt @@ -35,7 +35,7 @@ set(incs set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_CUDA_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs}) -target_link_libraries(${LIB_NAME} pcl_common) +target_link_libraries(${LIB_NAME} pcl_common pcl_io pcl_cuda_common) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} EXT_DEPS ${SUBSYS_EXT_DEPS}) diff --git a/cuda/segmentation/CMakeLists.txt b/cuda/segmentation/CMakeLists.txt index 5354513e040..d32560f8444 100644 --- a/cuda/segmentation/CMakeLists.txt +++ b/cuda/segmentation/CMakeLists.txt @@ -25,7 +25,7 @@ set(srcs set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_CUDA_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs}) -target_link_libraries(${LIB_NAME} pcl_common) +target_link_libraries(${LIB_NAME} pcl_common pcl_io pcl_cuda_common) set(EXT_DEPS "") #set(EXT_DEPS CUDA) diff --git a/examples/geometry/CMakeLists.txt b/examples/geometry/CMakeLists.txt index 271296c6819..4f3696605a8 100644 --- a/examples/geometry/CMakeLists.txt +++ b/examples/geometry/CMakeLists.txt @@ -3,4 +3,4 @@ if(NOT BUILD_geometry) endif() PCL_SUBSYS_DEPEND(build NAME ${SUBSYS_NAME} DEPS geometry) -PCL_ADD_EXAMPLE(pcl_example_half_edge_mesh FILES example_half_edge_mesh.cpp LINK_WITH pcl_common) +PCL_ADD_EXAMPLE(pcl_example_half_edge_mesh FILES example_half_edge_mesh.cpp LINK_WITH pcl_common pcl_geometry) diff --git a/features/CMakeLists.txt b/features/CMakeLists.txt index 2b280563372..5589b871102 100644 --- a/features/CMakeLists.txt +++ b/features/CMakeLists.txt @@ -168,7 +168,7 @@ endif() set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) -target_link_libraries("${LIB_NAME}" pcl_common pcl_search pcl_kdtree pcl_octree pcl_filters) +target_link_libraries("${LIB_NAME}" pcl_common pcl_2d pcl_search pcl_kdtree pcl_octree pcl_filters) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS}) # Install headers PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs}) diff --git a/segmentation/CMakeLists.txt b/segmentation/CMakeLists.txt index 85b3f64be55..92859de2408 100644 --- a/segmentation/CMakeLists.txt +++ b/segmentation/CMakeLists.txt @@ -99,7 +99,7 @@ set(impl_incs set(LIB_NAME "pcl_${SUBSYS_NAME}") PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) -target_link_libraries("${LIB_NAME}" pcl_search pcl_sample_consensus pcl_filters pcl_ml pcl_features) +target_link_libraries("${LIB_NAME}" pcl_geometry pcl_search pcl_sample_consensus pcl_filters pcl_ml pcl_features) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS}) # Install include files diff --git a/test/io/CMakeLists.txt b/test/io/CMakeLists.txt index 3b0f90546ea..9cbef820328 100644 --- a/test/io/CMakeLists.txt +++ b/test/io/CMakeLists.txt @@ -1,6 +1,6 @@ set(SUBSYS_NAME tests_io) set(SUBSYS_DESC "Point cloud library io module unit tests") -PCL_SET_TEST_DEPENDENCIES(SUBSYS_DEPS io) +PCL_SET_TEST_DEPENDENCIES(SUBSYS_DEPS common io octree) set(OPT_DEPS visualization) PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ON) @@ -53,7 +53,7 @@ PCL_ADD_TEST(point_cloud_image_extractors test_point_cloud_image_extractors PCL_ADD_TEST(buffers test_buffers FILES test_buffers.cpp - LINK_WITH pcl_gtest pcl_common) + LINK_WITH pcl_gtest pcl_common pcl_io) PCL_ADD_TEST(io_octree_compression test_octree_compression FILES test_octree_compression.cpp diff --git a/test/octree/CMakeLists.txt b/test/octree/CMakeLists.txt index b6de3599c3d..43fcb734ced 100644 --- a/test/octree/CMakeLists.txt +++ b/test/octree/CMakeLists.txt @@ -11,7 +11,7 @@ endif() PCL_ADD_TEST(a_octree_test test_octree FILES test_octree.cpp - LINK_WITH pcl_gtest pcl_common) + LINK_WITH pcl_gtest pcl_common pcl_octree) PCL_ADD_TEST(a_octree_iterator_test test_octree_iterator FILES test_octree_iterator.cpp LINK_WITH pcl_gtest pcl_common pcl_octree) diff --git a/test/recognition/CMakeLists.txt b/test/recognition/CMakeLists.txt index 09a4953da90..0377cfda7f2 100644 --- a/test/recognition/CMakeLists.txt +++ b/test/recognition/CMakeLists.txt @@ -12,7 +12,7 @@ endif() PCL_ADD_TEST(a_recognition_ism_test test_recognition_ism FILES test_recognition_ism.cpp - LINK_WITH pcl_gtest pcl_io pcl_features + LINK_WITH pcl_gtest pcl_io pcl_features pcl_recognition ARGUMENTS "${PCL_SOURCE_DIR}/test/ism_train.pcd" "${PCL_SOURCE_DIR}/test/ism_test.pcd") if(BUILD_keypoints) diff --git a/test/registration/CMakeLists.txt b/test/registration/CMakeLists.txt index 2be909db052..7b730acf5fa 100644 --- a/test/registration/CMakeLists.txt +++ b/test/registration/CMakeLists.txt @@ -1,6 +1,6 @@ set(SUBSYS_NAME tests_registration) set(SUBSYS_DESC "Point cloud library registration module unit tests") -PCL_SET_TEST_DEPENDENCIES(SUBSYS_DEPS registration) +PCL_SET_TEST_DEPENDENCIES(SUBSYS_DEPS io registration) set(OPT_DEPS io) # module does not depend on these PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ON) @@ -16,7 +16,7 @@ PCL_ADD_TEST(registration_warp_api test_warps PCL_ADD_TEST(correspondence_estimation test_correspondence_estimation FILES test_correspondence_estimation.cpp - LINK_WITH pcl_gtest pcl_registration pcl_features) + LINK_WITH pcl_gtest pcl_io pcl_registration pcl_features) if(BUILD_io) PCL_ADD_TEST(a_registration_test test_registration diff --git a/visualization/CMakeLists.txt b/visualization/CMakeLists.txt index 8446cb4f31d..e1349e02b3f 100644 --- a/visualization/CMakeLists.txt +++ b/visualization/CMakeLists.txt @@ -140,7 +140,7 @@ if(APPLE) target_link_libraries("${LIB_NAME}" "-framework Cocoa") endif() -target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree ${OPENGL_LIBRARIES}) +target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree pcl_geometry pcl_search ${OPENGL_LIBRARIES}) if(${VTK_VERSION} VERSION_GREATER_EQUAL 9.0) #Some libs are referenced through depending on IO