1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-10-25 04:27:39 +00:00

Handle redefinition of Boost_VERSION variable in CMake 3.15

See Policy CMP0093 https://cmake.org/cmake/help/v3.15/policy/CMP0093.html#policy:CMP0093
CMake 3.15 policies enabled by default (see https://cmake.org/cmake/help/v3.15/manual/cmake-policies.7.html#manual:cmake-policies(7) )
This commit is contained in:
Carles Fernandez
2019-07-22 14:13:57 +02:00
parent 5ba04708a9
commit 09b6b2305e
9 changed files with 27 additions and 33 deletions

View File

@@ -44,7 +44,7 @@ target_include_directories(pvt_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
if(Boost_VERSION LESS 105800)
if(Boost_VERSION_STRING VERSION_LESS 1.58.0)
target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1)
endif()

View File

@@ -62,7 +62,7 @@ if(ENABLE_CLANG_TIDY)
endif()
endif()
if(Boost_VERSION LESS 105800)
if(Boost_VERSION_STRING VERSION_LESS 1.58.0)
target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1)
endif()

View File

@@ -95,7 +95,7 @@ target_include_directories(pvt_libs
target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
if(Boost_VERSION VERSION_GREATER "106599")
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
target_compile_definitions(pvt_libs
PUBLIC
-DBOOST_GREATER_1_65
@@ -104,7 +104,7 @@ endif()
# Fix for Boost Asio < 1.70
if(OS_IS_MACOSX)
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
if(${has_string_view})
target_compile_definitions(pvt_libs
PUBLIC

View File

@@ -73,23 +73,21 @@ if(ENABLE_BAD_BOOST)
message(STATUS "Enabling use of known bad versions of Boost.")
endif()
# For any unsuitable Boost version, add the version number below in
# the following format: XXYYZZ
# Where:
# XX is the major version ('10' for version 1)
# YY is the minor version number ('46' for 1.46)
# ZZ is the patcher version number (typically just '00')
set(Boost_NOGO_VERSIONS
104600 104601 104700 105200
"1.46.0" "1.46.1" "1.47.0" "1.52.0"
)
if(CMAKE_VERSION VERSION_LESS 3.14)
set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
endif()
foreach(ver ${Boost_NOGO_VERSIONS})
if("${Boost_VERSION}" STREQUAL "${ver}")
if("${Boost_VERSION_STRING}" STREQUAL "${ver}")
if(NOT ENABLE_BAD_BOOST)
message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.")
message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION_STRING}). Disabling.")
set(Boost_FOUND FALSE)
else()
message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.")
message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION_STRING}). Continuing anyway.")
set(Boost_FOUND TRUE)
endif()
endif()

View File

@@ -83,7 +83,7 @@ endif()
# Fix for Boost Asio < 1.70
if(OS_IS_MACOSX)
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
if(${has_string_view})
target_compile_definitions(signal_source_gr_blocks
PUBLIC
@@ -98,7 +98,7 @@ if(OS_IS_MACOSX)
endif()
endif()
if(Boost_VERSION VERSION_GREATER "106599")
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
target_compile_definitions(signal_source_gr_blocks
PUBLIC
-DBOOST_GREATER_1_65

View File

@@ -110,7 +110,7 @@ if(NOT CMAKE_VERSION VERSION_GREATER 3.11)
)
endif()
if(Boost_VERSION VERSION_GREATER "106599")
if(Boost_VERSION_STRING VERSION_GREATER 1.65.99)
target_compile_definitions(tracking_libs
PUBLIC
-DBOOST_GREATER_1_65
@@ -119,7 +119,7 @@ endif()
# Fix for Boost Asio < 1.70
if(OS_IS_MACOSX)
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (${Boost_VERSION} VERSION_LESS 107000))
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
if(${has_string_view})
target_compile_definitions(tracking_libs
PUBLIC