1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-13 16:56:52 +00:00

Find Glog in MacOS when only the static version is installed

This commit is contained in:
Carles Fernandez 2019-08-11 09:12:15 +02:00
parent fe6260df99
commit 66cabb83e5
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -85,6 +85,7 @@ macro(_FIND_GLOG_LIBRARIES _var)
${GLOG_ROOT}/lib64 ${GLOG_ROOT}/lib64
$ENV{GLOG_ROOT}/lib64 $ENV{GLOG_ROOT}/lib64
${PC_GLOG_LIBDIR} ${PC_GLOG_LIBDIR}
/opt/local/lib
PATH_SUFFIXES lib PATH_SUFFIXES lib
) )
mark_as_advanced(${_var}) mark_as_advanced(${_var})
@ -126,7 +127,7 @@ else()
_find_glog_libraries(GLOG_LIBRARIES libglog.so) _find_glog_libraries(GLOG_LIBRARIES libglog.so)
endif() endif()
if(APPLE) if(APPLE)
_find_glog_libraries(GLOG_LIBRARIES libglog.dylib) _find_glog_libraries(GLOG_LIBRARIES glog)
endif() endif()
endif() endif()
@ -167,8 +168,13 @@ set_package_properties(GLOG PROPERTIES
URL "https://github.com/google/glog" URL "https://github.com/google/glog"
) )
string(REGEX MATCH libglog.a GLOG_IS_STATIC ${GLOG_LIBRARIES})
if(GLOG_FOUND AND NOT TARGET Glog::glog) if(GLOG_FOUND AND NOT TARGET Glog::glog)
add_library(Glog::glog SHARED IMPORTED) if(GLOG_IS_STATIC)
add_library(Glog::glog STATIC IMPORTED)
else()
add_library(Glog::glog SHARED IMPORTED)
endif()
set_target_properties(Glog::glog PROPERTIES set_target_properties(Glog::glog PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GLOG_LIBRARIES}" IMPORTED_LOCATION "${GLOG_LIBRARIES}"