vcpkg/ports/osg/link-libraries.patch
Kai Pastor 62850c28d0
[vcpkg baseline][osg] Fix port dependencies and build errors (#26698)
* Don't depend on default features

* Use OpenEXR config

* Try to skip non-portable check_cxx_source_runs

* Ensure PKG_CONFIG_USE_CMAKE_PREFIX_PATH

* Use link libraries from pkg-config

* Revise feature-to-CMake mapping

* Update versions
2022-09-14 11:24:49 -07:00

22 lines
954 B
Diff

diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake
index ce55be0..9b7107c 100644
--- a/CMakeModules/OsgMacroUtils.cmake
+++ b/CMakeModules/OsgMacroUtils.cmake
@@ -37,6 +37,16 @@ SET(VALID_BUILDER_VERSION OFF)
MACRO(LINK_WITH_VARIABLES TRGTNAME)
FOREACH(varname ${ARGN})
+ string(REPLACE "_LIBRARY" "_LINK_LIBRARIES" lwv_link_libraries "${varname}")
+ if(DEFINED ${lwv_link_libraries})
+ TARGET_LINK_LIBRARIES(${TRGTNAME} ${${lwv_link_libraries}})
+ continue()
+ endif()
+ string(REPLACE "_LIBRARY" "_LIBRARIES" lwv_libraries "${varname}")
+ if(DEFINED ${lwv_libraries})
+ TARGET_LINK_LIBRARIES(${TRGTNAME} ${${lwv_libraries}})
+ continue()
+ endif()
IF(${varname}_DEBUG)
IF(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}")