mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-15 11:45:47 +00:00
Fixes bug that made configuration crash when glog and gflags were not installed and the script was run twice before doing 'make'
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@468 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
a6eaff8a65
commit
0d16ac4a69
@ -273,7 +273,7 @@ set(LOCAL_GFLAGS false CACHE STRING "GFlags installed on the system")
|
||||
set(GFlags_ROOT_DIR false)
|
||||
find_package(GFlags)
|
||||
|
||||
if (NOT GFlags_FOUND)
|
||||
if (NOT GFlags_FOUND OR LOCAL_GLOG)
|
||||
message (STATUS " gflags library has not been found.")
|
||||
message (STATUS " gflags will be downloaded and built automatically ")
|
||||
message (STATUS " when doing 'make'. ")
|
||||
@ -298,19 +298,20 @@ if (NOT GFlags_FOUND)
|
||||
set(GFlags_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/src CACHE PATH "Local Gflags headers"
|
||||
)
|
||||
set(GFlags_LIBS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}gflags.a
|
||||
)
|
||||
|
||||
add_library(gflags UNKNOWN IMPORTED)
|
||||
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}gflags.a)
|
||||
add_dependencies(gflags gflags-${gflags_RELEASE})
|
||||
set(GFlags_LIBS gflags)
|
||||
set(GFlags_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE} CACHE PATH "GFlags root folder" FORCE)
|
||||
file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*")
|
||||
set(GFlags_LIBRARY gflags-${gflags_RELEASE})
|
||||
set(gflags gflags-${gflags_RELEASE})
|
||||
set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs )
|
||||
link_directories(${GFlags_LIBRARY_PATH})
|
||||
set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library")
|
||||
set(GFlags_LIBRARY_PATH ${GFlags_LIBS})
|
||||
set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and build automatically" FORCE)
|
||||
endif(NOT GFlags_FOUND)
|
||||
set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE)
|
||||
endif(NOT GFlags_FOUND OR LOCAL_GLOG)
|
||||
|
||||
|
||||
|
||||
@ -376,7 +377,7 @@ export LIBS=${GFlags_SHARED_LIBS}
|
||||
set(GLOG_LIBRARIES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.a
|
||||
)
|
||||
set(LOCAL_GLOG true)
|
||||
set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE)
|
||||
endif(NOT GLOG_FOUND OR LOCAL_GFLAGS)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user