mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-26 00:46:59 +00:00
Preserve PACKAGE_VERSION variable if it exists
This commit is contained in:
parent
b19fad4b63
commit
52b70af104
@ -117,6 +117,8 @@ include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS)
|
||||
|
||||
if(GFLAGS_FOUND)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
list(GET GFlags_LIBS 0 FIRST_DIR)
|
||||
get_filename_component(GFlags_LIBS_DIR ${FIRST_DIR} DIRECTORY)
|
||||
if(EXISTS ${GFlags_LIBS_DIR}/cmake/gflags/gflags-config-version.cmake)
|
||||
@ -132,7 +134,7 @@ if(GFLAGS_FOUND)
|
||||
DESCRIPTION "C++ library that implements commandline flags processing"
|
||||
)
|
||||
endif()
|
||||
unset(PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
else()
|
||||
set_package_properties(GFLAGS PROPERTIES
|
||||
DESCRIPTION "C++ library that implements commandline flags processing"
|
||||
|
@ -187,6 +187,8 @@ list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES)
|
||||
|
||||
if(NOT PC_GNURADIO_RUNTIME_VERSION)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
list(GET GNURADIO_BLOCKS_LIBRARIES 0 FIRST_DIR)
|
||||
get_filename_component(GNURADIO_BLOCKS_DIR ${FIRST_DIR} DIRECTORY)
|
||||
if(EXISTS ${GNURADIO_BLOCKS_DIR}/cmake/gnuradio/GnuradioConfigVersion.cmake)
|
||||
@ -198,7 +200,7 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION)
|
||||
if(PACKAGE_VERSION)
|
||||
set(PC_GNURADIO_RUNTIME_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
unset(PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present
|
||||
|
@ -54,13 +54,15 @@ include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
||||
|
||||
if(GPSTK_FOUND)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
if(EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
||||
include(${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
||||
endif()
|
||||
if(PACKAGE_VERSION)
|
||||
set(GPSTK_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
unset(PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
if(GPSTK_FOUND AND GPSTK_VERSION)
|
||||
|
@ -60,6 +60,8 @@ if(PC_TELEORBIT_VERSION)
|
||||
endif()
|
||||
|
||||
if(NOT TELEORBIT_VERSION)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
list(GET TELEORBIT_LIBRARIES 0 FIRST_DIR)
|
||||
get_filename_component(TELEORBIT_LIBRARIES_DIR ${FIRST_DIR} DIRECTORY)
|
||||
if(EXISTS ${TELEORBIT_LIBRARIES_DIR}/cmake/teleorbit/TeleorbitConfigVersion.cmake)
|
||||
@ -68,7 +70,7 @@ if(NOT TELEORBIT_VERSION)
|
||||
if(PACKAGE_VERSION)
|
||||
set(TELEORBIT_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
unset(PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
if(TELEORBIT_FOUND AND TELEORBIT_VERSION)
|
||||
|
@ -86,6 +86,8 @@ if(PC_UHD_VERSION)
|
||||
set(UHD_VERSION ${PC_UHD_VERSION})
|
||||
endif()
|
||||
if(NOT PC_UHD_VERSION)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
list(GET UHD_LIBRARIES 0 FIRST_DIR)
|
||||
get_filename_component(UHD_LIBRARIES_DIR ${FIRST_DIR} DIRECTORY)
|
||||
if(EXISTS ${UHD_LIBRARIES_DIR}/cmake/uhd/UHDConfigVersion.cmake)
|
||||
@ -94,7 +96,7 @@ if(NOT PC_UHD_VERSION)
|
||||
if(PACKAGE_VERSION)
|
||||
set(UHD_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
unset(PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
set_package_properties(UHD PROPERTIES
|
||||
|
@ -88,6 +88,8 @@ if(PC_VOLK_VERSION)
|
||||
endif()
|
||||
|
||||
if(NOT VOLK_VERSION)
|
||||
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||
unset(PACKAGE_VERSION)
|
||||
list(GET VOLK_LIBRARIES 0 FIRST_DIR)
|
||||
get_filename_component(VOLK_LIB_DIR ${FIRST_DIR} DIRECTORY)
|
||||
if(EXISTS ${VOLK_LIB_DIR}/cmake/volk/VolkConfigVersion.cmake)
|
||||
@ -96,7 +98,7 @@ if(NOT VOLK_VERSION)
|
||||
if(PACKAGE_VERSION)
|
||||
set(VOLK_VERSION ${PACKAGE_VERSION})
|
||||
endif()
|
||||
unset(PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
||||
endif()
|
||||
|
||||
set_package_properties(VOLK PROPERTIES
|
||||
|
Loading…
Reference in New Issue
Block a user