Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix link-type keywords in linked libraries in "PCLConfig.cmake" with CMake >= 3.11 #3341

Merged
merged 2 commits into from
Sep 14, 2019
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
13 changes: 12 additions & 1 deletion PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
INTERFACE_INCLUDE_DIRECTORIES "${PCL_${COMPONENT}_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${PCL_${COMPONENT}_LINK_LIBRARIES}"
)
else()
elseif(CMAKE_VERSION VERSION_LESS 3.11)
set_target_properties(${pcl_component}
PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${definitions}"
Expand All @@ -628,6 +628,17 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
INTERFACE_INCLUDE_DIRECTORIES "${PCL_${COMPONENT}_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${PCL_${COMPONENT}_LINK_LIBRARIES}"
)
else()
set_target_properties(${pcl_component}
PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${definitions}"
INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:CXX>:${PCL_COMPILE_OPTIONS}>"
INTERFACE_INCLUDE_DIRECTORIES "${PCL_${COMPONENT}_INCLUDE_DIRS}"
)
# If possible, we use target_link_libraries to avoid problems with link-type keywords,
# see https://github.com/PointCloudLibrary/pcl/issues/2989
# target_link_libraries on imported libraries is supported only since CMake 3.11
target_link_libraries(${pcl_component} INTERFACE ${PCL_${COMPONENT}_LINK_LIBRARIES})
endif()
set(PCL_${COMPONENT}_LIBRARIES ${pcl_component})
endif()
Expand Down