Skip to content
Merged
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
12 changes: 12 additions & 0 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,15 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
add_library(${pcl_component} INTERFACE IMPORTED)
endif()

# Namespaced alias targets, e.g. PCL::common. An ALIAS of a non-global
# imported target requires CMake >= 3.18, so emulate it for older versions.
if(CMAKE_VERSION VERSION_LESS 3.18.0)
add_library(PCL::${component} INTERFACE IMPORTED)
target_link_libraries(PCL::${component} INTERFACE ${pcl_component})
else()
add_library(PCL::${component} ALIAS ${pcl_component})
endif()

foreach(def ${PCL_DEFINITIONS})
string(REPLACE " " ";" def2 ${def})
string(REGEX REPLACE "^-D" "" def3 "${def2}")
Expand Down Expand Up @@ -749,6 +758,9 @@ endif()

pcl_remove_duplicate_libraries(PCL_COMPONENTS PCL_LIBRARIES)

add_library(PCL::PCL INTERFACE IMPORTED)
target_link_libraries(PCL::PCL INTERFACE ${PCL_COMPONENTS})

# Add 3rd party libraries, as user code might include our .HPP implementations
list(APPEND PCL_LIBRARIES ${PCL_BOOST_LIBRARIES} ${PCL_OPENNI_LIBRARIES} ${PCL_OPENNI2_LIBRARIES} ${PCL_ENSENSO_LIBRARIES} ${PCL_davidSDK_LIBRARIES} ${PCL_DSSDK_LIBRARIES} ${PCL_RSSDK_LIBRARIES} ${PCL_RSSDK2_LIBRARIES} ${PCL_VTK_LIBRARIES})
if (TARGET FLANN::FLANN)
Expand Down