Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
larshg committed Apr 18, 2024
1 parent 3e166ea commit 1c65670
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 49 deletions.
1 change: 1 addition & 0 deletions 2d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/3d_rec_framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 2 additions & 2 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions apps/cloud_composer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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})

Expand Down
2 changes: 1 addition & 1 deletion apps/in_hand_scanner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion apps/modeler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 30 additions & 29 deletions cmake/pcl_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()

Expand Down Expand Up @@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_ROOT}>
)

add_library(${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES})

PCL_ADD_VERSION_INFO(${_name})

target_compile_options(${_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: ${GEN_CODE} --expt-relaxed-constexpr>)

target_include_directories(${_name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_ROOT}>
)

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 $<$<COMPILE_LANGUAGE:CUDA>: ${GEN_CODE} --expt-relaxed-constexpr>)

target_include_directories(${_name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_ROOT}>
)

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}
Expand Down
1 change: 1 addition & 0 deletions cuda/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cuda/features/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cuda/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
2 changes: 1 addition & 1 deletion cuda/segmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion features/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion segmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/io/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/octree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion test/recognition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/registration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion visualization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c65670

Please sign in to comment.