summaryrefslogtreecommitdiffstats
path: root/Modules/FindBoost.cmake
diff options
context:
space:
mode:
authorDennis Klein <d.klein@gsi.de>2019-05-03 18:23:08 (GMT)
committerBrad King <brad.king@kitware.com>2019-05-13 15:57:12 (GMT)
commit5108759ed2bb211105f02fcc857fc89f3db768f0 (patch)
treeda3ffd543d18d689344268d19d208f416fa8540b /Modules/FindBoost.cmake
parentf9feab40a195716a6bba11b39a809a18830df956 (diff)
downloadCMake-5108759ed2bb211105f02fcc857fc89f3db768f0.zip
CMake-5108759ed2bb211105f02fcc857fc89f3db768f0.tar.gz
CMake-5108759ed2bb211105f02fcc857fc89f3db768f0.tar.bz2
FindBoost: Introduce CMP0093 to report Boost_VERSION in x.y.z format
This aligns module mode behaviour with config mode.
Diffstat (limited to 'Modules/FindBoost.cmake')
-rw-r--r--Modules/FindBoost.cmake15
1 files changed, 12 insertions, 3 deletions
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 0f15190..23549cb 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -30,9 +30,10 @@ case results are reported in variables::
Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
target_link_libraries debug/optimized keywords)
- Boost_VERSION - BOOST_VERSION value from boost/version.hpp
- alias: Boost_VERSION_MACRO
+ Boost_VERSION_MACRO - BOOST_VERSION value from boost/version.hpp
Boost_VERSION_STRING - Boost version number in x.y.z format
+ Boost_VERSION - if CMP0093 NEW => same as Boost_VERSION_STRING
+ if CMP0093 OLD or unset => same as Boost_VERSION_MACRO
Boost_LIB_VERSION - Version string appended to library filenames
Boost_VERSION_MAJOR - Boost major version number (X in X.y.z)
alias: Boost_MAJOR_VERSION
@@ -1427,7 +1428,15 @@ if(Boost_INCLUDE_DIR)
set(Boost_VERSION_STRING "${Boost_VERSION_MAJOR}.${Boost_VERSION_MINOR}.${Boost_VERSION_PATCH}")
# Define final Boost_VERSION
- set(Boost_VERSION ${Boost_VERSION_MACRO})
+ cmake_policy(GET CMP0093 _Boost_CMP0093
+ PARENT_SCOPE # undocumented, do not use outside of CMake
+ )
+ if("x${_Boost_CMP0093}x" STREQUAL "xNEWx")
+ set(Boost_VERSION ${Boost_VERSION_STRING})
+ else()
+ set(Boost_VERSION ${Boost_VERSION_MACRO})
+ endif()
+ unset(_Boost_CMP0093)
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "