diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/CMakeMacroLibtoolFile.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake index 14951285..1115c0d3 100644 --- a/cmake/Modules/CMakeMacroLibtoolFile.cmake +++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake @@ -89,15 +89,19 @@ macro(libtool_create_control_file _target) endif() if(STATIC_MODE) - set(library ${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(_library ${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX}) + find_library(FL ${_library} PATHS ${LIBRARY_PATHS}) + endif() + + if(NOT FL) + find_library(FL ${library} PATHS ${LIBRARY_PATHS}) endif() - 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 # result to the libtool dependency libs. - if(STATIC_MODE) + if("${FL}" MATCHES ".+${CMAKE_STATIC_LIBRARY_SUFFIX}$") set(_target_dependency_libs "${_target_dependency_libs} ${FL}") else() get_filename_component(_shared_lib ${FL} NAME_WE) |