Commit 3b4cda66 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Fix version issue with LAST_EXT

parent 2a859b03
......@@ -40,12 +40,19 @@ macro(LIBRARIES_ABSOLUTE_PATH lib_list hints_paths)
string(REGEX REPLACE "^-l" "" _library "${_library}")
# remove extensions if exist
get_filename_component(_lext "${_library}" LAST_EXT)
get_filename_component(_ext "${_library}" EXT)
if ( "${_lext}" IN_LIST CMAKE_FIND_LIBRARY_SUFFIXES )
get_filename_component(_library "${_library}" NAME_WLE)
elseif ( "${_ext}" IN_LIST CMAKE_FIND_LIBRARY_SUFFIXES )
get_filename_component(_library "${_library}" NAME_WE)
if( ${CMAKE_VERSION} VERSION_GREATER "3.14.0" )
get_filename_component(_lext "${_library}" LAST_EXT)
get_filename_component(_ext "${_library}" EXT)
if ( "${_lext}" IN_LIST CMAKE_FIND_LIBRARY_SUFFIXES )
get_filename_component(_library "${_library}" NAME_WLE)
elseif ( "${_ext}" IN_LIST CMAKE_FIND_LIBRARY_SUFFIXES )
get_filename_component(_library "${_library}" NAME_WE)
endif()
else()
get_filename_component(_ext "${_library}" EXT)
if ( "${_ext}" IN_LIST CMAKE_FIND_LIBRARY_SUFFIXES )
get_filename_component(_library "${_library}" NAME_WE)
endif()
endif()
# try to find the lib
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment