diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-11-16 07:56:41 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-01-10 19:41:13 +0100 |
commit | 651e7633381453e7a33052b23b1a85b6d81b4449 (patch) | |
tree | 5d029fd7b7643131d5eabfe4ca0adc252aaf1d97 | |
parent | b1943de68662d5adc216b809e640009e617c09ed (diff) | |
download | tigervnc-651e7633381453e7a33052b23b1a85b6d81b4449.tar.gz tigervnc-651e7633381453e7a33052b23b1a85b6d81b4449.zip |
Respect library search paths
Things might be in odd places, so make sure we respect where we're told
to look for libraries.
-rw-r--r-- | cmake/Modules/CMakeMacroLibtoolFile.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake index 88ff335a..14951285 100644 --- a/cmake/Modules/CMakeMacroLibtoolFile.cmake +++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake @@ -29,6 +29,8 @@ macro(libtool_create_control_file _target) set(STATIC_MODE OFF) set(FRAMEWORK OFF) + get_property(LIBRARY_PATHS TARGET ${_target} + PROPERTY INTERFACE_LINK_DIRECTORIES) foreach(library ${target_libs}) if(FRAMEWORK) @@ -73,6 +75,10 @@ macro(libtool_create_control_file _target) elseif(${library} STREQUAL "-Wl,-Bdynamic") # All following libraries should be dynamic set(STATIC_MODE OFF) + elseif(${library} MATCHES "^${CMAKE_LIBRARY_PATH_FLAG}") + # Library search path + string(REPLACE ${CMAKE_LIBRARY_PATH_FLAG} "" library ${library}) + list(APPEND LIBRARY_PATHS ${library}) else() # Normal library, so use find_library() to attempt to locate the # library in a system directory. @@ -86,7 +92,7 @@ macro(libtool_create_control_file _target) set(library ${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX}) endif() - find_library(FL ${library}) + find_library(FL ${library} PATHS ${LIBRARY_PATHS}) if(FL) # Found library. Depending on if it's static or not we might # extract the path and library name, then add the |