cmake: check whether SONAME actualy exists

//Have include libunwind.h
This commit is contained in:
Anonymous Maarten 2023-07-04 23:40:11 +02:00 committed by Anonymous Maarten
parent 0262f757e1
commit 1c6a649362

View file

@ -18,6 +18,7 @@ macro(FindLibraryAndSONAME _LIB)
# reduce the library name for shared linking # reduce the library name for shared linking
get_filename_component(_LIB_REALPATH ${${_LNAME}_LIB} REALPATH) # resolves symlinks get_filename_component(_LIB_REALPATH ${${_LNAME}_LIB} REALPATH) # resolves symlinks
get_filename_component(_LIB_DIRECTORY ${_LIB_REALPATH} DIRECTORY)
get_filename_component(_LIB_JUSTNAME ${_LIB_REALPATH} NAME) get_filename_component(_LIB_JUSTNAME ${_LIB_REALPATH} NAME)
if(APPLE) if(APPLE)
@ -26,6 +27,11 @@ macro(FindLibraryAndSONAME _LIB)
string(REGEX REPLACE "(\\.[0-9]*)\\.[0-9\\.]*$" "\\1" _LIB_REGEXD "${_LIB_JUSTNAME}") string(REGEX REPLACE "(\\.[0-9]*)\\.[0-9\\.]*$" "\\1" _LIB_REGEXD "${_LIB_JUSTNAME}")
endif() endif()
if(NOT EXISTS "${_LIB_DIRECTORY}/${_LIB_REGEXD}")
set(_LIB_REGEXD "${_LIB_JUSTNAME}")
endif()
set(${_LNAME}_LIBDIR "${_LIB_LIBDIR}")
SET(_DEBUG_FindSONAME FALSE) SET(_DEBUG_FindSONAME FALSE)
if(_DEBUG_FindSONAME) if(_DEBUG_FindSONAME)
message_warn("DYNLIB OUTPUTVAR: ${_LIB} ... ${_LNAME}_LIB") message_warn("DYNLIB OUTPUTVAR: ${_LIB} ... ${_LNAME}_LIB")