mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-30 10:54:50 +00:00
Merge branch 'cmake-glog' into next
Make it easier to build the code with Xcode and in Debug mode.
This commit is contained in:
commit
2e4517a3b9
154
CMakeLists.txt
154
CMakeLists.txt
@ -373,6 +373,9 @@ endif()
|
|||||||
if(CMAKE_MAKE_PROGRAM MATCHES "ninja")
|
if(CMAKE_MAKE_PROGRAM MATCHES "ninja")
|
||||||
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja")
|
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja")
|
||||||
endif()
|
endif()
|
||||||
|
if(CMAKE_MAKE_PROGRAM MATCHES "xcodebuild")
|
||||||
|
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "xcodebuild")
|
||||||
|
endif()
|
||||||
if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME)
|
if(NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME)
|
||||||
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}")
|
set(CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}")
|
||||||
endif()
|
endif()
|
||||||
@ -1079,7 +1082,11 @@ set_package_properties(GFLAGS PROPERTIES
|
|||||||
if(NOT GFLAGS_FOUND)
|
if(NOT GFLAGS_FOUND)
|
||||||
message(STATUS " gflags library has not been found.")
|
message(STATUS " gflags library has not been found.")
|
||||||
message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically")
|
message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically")
|
||||||
message(STATUS " when doing 'make'.")
|
message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.")
|
||||||
|
set(GFLAGS_BUILD_COMMAND ${CMAKE_MAKE_PROGRAM})
|
||||||
|
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
|
set(GFLAGS_BUILD_COMMAND "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.2)
|
if(CMAKE_VERSION VERSION_LESS 3.2)
|
||||||
ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
@ -1088,8 +1095,8 @@ if(NOT GFLAGS_FOUND)
|
|||||||
GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
BUILD_COMMAND ${GFLAGS_BUILD_COMMAND}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
PATCH_COMMAND ""
|
PATCH_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
@ -1101,8 +1108,8 @@ if(NOT GFLAGS_FOUND)
|
|||||||
GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}
|
||||||
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
CMAKE_ARGS -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_nothreads_LIB=OFF -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
BUILD_COMMAND ${GFLAGS_BUILD_COMMAND}
|
||||||
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}
|
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
PATCH_COMMAND ""
|
PATCH_COMMAND ""
|
||||||
@ -1113,21 +1120,28 @@ if(NOT GFLAGS_FOUND)
|
|||||||
set(GFlags_INCLUDE_DIRS
|
set(GFlags_INCLUDE_DIRS
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers"
|
${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers"
|
||||||
)
|
)
|
||||||
|
if((CMAKE_BUILD_TYPE MATCHES Debug) AND (CMAKE_VERSION VERSION_GREATER "3.0.2"))
|
||||||
file(GLOB GFlags_SHARED_LIBS
|
set(GFLAGS_DEBUG_POSTFIX "_debug")
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*"
|
endif()
|
||||||
|
set(GFlags_LIBS
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${GFLAGS_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
)
|
)
|
||||||
|
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
|
set(GFlags_LIBS
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_BUILD_TYPE}/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${GFLAGS_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET Gflags::gflags)
|
if(NOT TARGET Gflags::gflags)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include)
|
file(MAKE_DIRECTORY ${GFlags_INCLUDE_DIRS})
|
||||||
add_library(Gflags::gflags STATIC IMPORTED)
|
add_library(Gflags::gflags STATIC IMPORTED)
|
||||||
add_dependencies(Gflags::gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
|
add_dependencies(Gflags::gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
|
||||||
set_target_properties(Gflags::gflags PROPERTIES
|
set_target_properties(Gflags::gflags PROPERTIES
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||||
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
IMPORTED_LOCATION "${GFlags_LIBS}"
|
||||||
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include"
|
INCLUDE_DIRECTORIES "${GFlags_INCLUDE_DIRS}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include"
|
INTERFACE_INCLUDE_DIRECTORIES "${GFlags_INCLUDE_DIRS}"
|
||||||
INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
INTERFACE_LINK_LIBRARIES "${GFlags_LIBS}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -1142,11 +1156,8 @@ endif()
|
|||||||
################################################################################
|
################################################################################
|
||||||
# glog - https://github.com/google/glog
|
# glog - https://github.com/google/glog
|
||||||
################################################################################
|
################################################################################
|
||||||
if(NOT ${ENABLE_OWN_GLOG})
|
if(NOT ENABLE_OWN_GLOG AND NOT ${LOCAL_GFLAGS})
|
||||||
find_package(GLOG)
|
find_package(GLOG)
|
||||||
if(GLOG_INCLUDE_DIRS)
|
|
||||||
set(GLOG_FOUND ON)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
set_package_properties(GLOG PROPERTIES
|
set_package_properties(GLOG PROPERTIES
|
||||||
PURPOSE "Used for runtime internal logging."
|
PURPOSE "Used for runtime internal logging."
|
||||||
@ -1158,12 +1169,28 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
|||||||
message(STATUS " or it is likely not linked to gflags.")
|
message(STATUS " or it is likely not linked to gflags.")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically")
|
message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically")
|
||||||
message(STATUS " when doing 'make'.")
|
message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.")
|
||||||
if(NOT ${LOCAL_GFLAGS})
|
if(NOT ${LOCAL_GFLAGS})
|
||||||
add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED)
|
add_library(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} UNKNOWN IMPORTED)
|
||||||
set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}")
|
set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}")
|
||||||
|
string(REPLACE /include "" GFLAGS_PREFIX_PATH ${GFlags_INCLUDE_DIRS})
|
||||||
|
else()
|
||||||
|
set(GFLAGS_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
|
||||||
endif()
|
endif()
|
||||||
set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
|
set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION})
|
||||||
|
set(GLOG_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
|
||||||
|
set(GLOG_BUILD_BYPRODUCTS
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
)
|
||||||
|
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
|
set(GLOG_MAKE_PROGRAM "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
set(GLOG_DEBUG_POSTFIX "d")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.2)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.0)
|
||||||
if(${LOCAL_GFLAGS})
|
if(${LOCAL_GFLAGS})
|
||||||
set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS})
|
set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_SHARED_LIBS})
|
||||||
set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib)
|
set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib)
|
||||||
@ -1179,7 +1206,6 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
|
|||||||
set(GLOG_EXPORT_C_COMPILER "export CC=clang")
|
set(GLOG_EXPORT_C_COMPILER "export CC=clang")
|
||||||
set(GLOG_EXPORT_CXX_COMPILER "export CXX=clang++")
|
set(GLOG_EXPORT_CXX_COMPILER "export CXX=clang++")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags
|
||||||
"#!/bin/sh
|
"#!/bin/sh
|
||||||
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
||||||
@ -1241,7 +1267,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(GLOG_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM})
|
|
||||||
if(GLOG_MAKE_PROGRAM MATCHES "ninja")
|
if(GLOG_MAKE_PROGRAM MATCHES "ninja")
|
||||||
find_program(GLOG_MAKE_EXECUTABLE make
|
find_program(GLOG_MAKE_EXECUTABLE make
|
||||||
PATHS
|
PATHS
|
||||||
@ -1253,8 +1278,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c
|
|||||||
endif()
|
endif()
|
||||||
set(GLOG_MAKE_PROGRAM ${GLOG_MAKE_EXECUTABLE})
|
set(GLOG_MAKE_PROGRAM ${GLOG_MAKE_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.2)
|
|
||||||
ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
DEPENDS ${TARGET_GFLAGS}
|
DEPENDS ${TARGET_GFLAGS}
|
||||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
@ -1268,45 +1291,80 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c
|
|||||||
PATCH_COMMAND ""
|
PATCH_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
)
|
)
|
||||||
else()
|
|
||||||
ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
|
||||||
DEPENDS ${TARGET_GFLAGS}
|
|
||||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
|
||||||
GIT_REPOSITORY https://github.com/google/glog/
|
|
||||||
GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION}
|
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
|
||||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
|
||||||
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
|
||||||
BUILD_COMMAND "${GLOG_MAKE_PROGRAM}"
|
|
||||||
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
|
|
||||||
UPDATE_COMMAND ""
|
|
||||||
PATCH_COMMAND ""
|
|
||||||
INSTALL_COMMAND ""
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
add_dependencies(glog-${GNSSSDR_GLOG_LOCAL_VERSION} Gflags::gflags)
|
|
||||||
|
|
||||||
# Set up variables
|
|
||||||
set(GLOG_INCLUDE_DIRS
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src/
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src
|
|
||||||
)
|
|
||||||
set(GLOG_LIBRARIES
|
set(GLOG_LIBRARIES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
)
|
)
|
||||||
|
set(GLOG_INCLUDE_DIRS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src
|
||||||
|
)
|
||||||
|
else() # CMake > 3.0 but < 3.2
|
||||||
|
ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
DEPENDS ${TARGET_GFLAGS}
|
||||||
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
GIT_REPOSITORY https://github.com/google/glog/
|
||||||
|
GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${GFLAGS_PREFIX_PATH}
|
||||||
|
BUILD_COMMAND "${GLOG_MAKE_PROGRAM}"
|
||||||
|
UPDATE_COMMAND ""
|
||||||
|
PATCH_COMMAND ""
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
)
|
||||||
|
set(GLOG_LIBRARIES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${GLOG_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
)
|
||||||
|
set(GLOG_INCLUDE_DIRS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
${GFlags_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
else() # CMake > 3.2
|
||||||
|
ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
DEPENDS ${TARGET_GFLAGS}
|
||||||
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
GIT_REPOSITORY https://github.com/google/glog/
|
||||||
|
GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${GFLAGS_PREFIX_PATH}
|
||||||
|
BUILD_COMMAND "${GLOG_MAKE_PROGRAM}"
|
||||||
|
BUILD_BYPRODUCTS ${GLOG_BUILD_BYPRODUCTS}
|
||||||
|
UPDATE_COMMAND ""
|
||||||
|
PATCH_COMMAND ""
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
)
|
||||||
|
set(GLOG_LIBRARIES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${GLOG_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
)
|
||||||
|
set(GLOG_INCLUDE_DIRS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}
|
||||||
|
${GFlags_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
add_dependencies(glog-${GNSSSDR_GLOG_LOCAL_VERSION} Gflags::gflags)
|
||||||
|
|
||||||
|
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
|
set(GLOG_LIBRARIES
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_BUILD_TYPE}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${GLOG_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Create Glog::glog target
|
# Create Glog::glog target
|
||||||
if(NOT TARGET Glog::glog)
|
if(NOT TARGET Glog::glog)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src)
|
||||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src)
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION})
|
||||||
add_library(Glog::glog STATIC IMPORTED)
|
add_library(Glog::glog STATIC IMPORTED)
|
||||||
add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION})
|
add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION})
|
||||||
set_target_properties(Glog::glog PROPERTIES
|
set_target_properties(Glog::glog PROPERTIES
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||||
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
IMPORTED_LOCATION "${GLOG_LIBRARIES}"
|
||||||
INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}"
|
INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}"
|
INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}"
|
||||||
INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
INTERFACE_LINK_LIBRARIES "${GLOG_LIBRARIES}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -263,6 +263,10 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
|||||||
set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=-Wno-deprecated")
|
set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=-Wno-deprecated")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
||||||
endif()
|
endif()
|
||||||
|
set(GPSTK_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}")
|
||||||
|
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
|
set(GPSTK_BUILD_COMMAND "xcodebuild" "-configuration" "${CMAKE_BUILD_TYPE}")
|
||||||
|
endif()
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.2)
|
if(CMAKE_VERSION VERSION_LESS 3.2)
|
||||||
ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
ExternalProject_Add(gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
@ -270,7 +274,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
|||||||
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
|
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
|
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
|
BUILD_COMMAND ${GPSTK_BUILD_COMMAND}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
PATCH_COMMAND ""
|
PATCH_COMMAND ""
|
||||||
)
|
)
|
||||||
@ -280,7 +285,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
|
|||||||
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
|
GIT_TAG v${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}
|
||||||
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF
|
CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||||
|
BUILD_COMMAND ${GPSTK_BUILD_COMMAND}
|
||||||
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}
|
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
PATCH_COMMAND ""
|
PATCH_COMMAND ""
|
||||||
|
@ -65,6 +65,7 @@ if(Boost_FOUND)
|
|||||||
Boost::serialization
|
Boost::serialization
|
||||||
${GPSTK_LIBRARY}
|
${GPSTK_LIBRARY}
|
||||||
Gflags::gflags
|
Gflags::gflags
|
||||||
|
Threads::Threads
|
||||||
algorithms_libs
|
algorithms_libs
|
||||||
core_receiver
|
core_receiver
|
||||||
core_system_parameters
|
core_system_parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user