forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pcl] Fix problem with link-type keywords in linked libraries
Fix microsoft#7660
- Loading branch information
1 parent
c85d63b
commit e71cc9e
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in | ||
index f1c2ca5..d28cb63 100644 | ||
--- a/PCLConfig.cmake.in | ||
+++ b/PCLConfig.cmake.in | ||
@@ -609,7 +609,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}" | ||
@@ -617,6 +617,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() |