From 9703cbfd70af34ab19dc908ed458976a39b25e2b Mon Sep 17 00:00:00 2001 From: LAVAUX Guilhem Date: Tue, 28 Apr 2020 21:08:27 +0200 Subject: [PATCH] Improvement for Boost detection --- external/external_build.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/external/external_build.cmake b/external/external_build.cmake index 43e0021..6f00ec6 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -247,17 +247,23 @@ if (INTERNAL_BOOST) ELSE (INTERNAL_BOOST) find_package(Boost 1.69 QUIET) - if (NOT Boost_FOUND) - cmessage(CWARNING "Boost >= 1.69 was not found") - else() - cmessage(STATUS "Boost has been found (version=${Boost_VERSION})") - endif() if (Boost_VERSION) + if (${Boost_VERSION} VERSION_GREATER 1000) + math(EXPR TMP_MAJOR "${Boost_VERSION} / 100000") + math(EXPR TMP_MINOR "(${Boost_VERSION} - ${TMP_MAJOR} * 100000) / 100") + math(EXPR TMP_PATCHLEVEL "${Boost_VERSION} - ${TMP_MAJOR} * 100000 - ${TMP_MINOR} * 100") + set(Boost_VERSION ${TMP_MAJOR}.${TMP_MINOR}.${TMP_PATCHLEVEL}) + ENDIF() if (${Boost_VERSION} VERSION_GREATER_EQUAL 1.70.0) set(Boost_DEP Boost::headers) set(Boost_TARGET Boost::headers) endif() endif() + if (NOT Boost_FOUND) + cmessage(CWARNING "Boost >= 1.69 was not found") + else() + cmessage(STATUS "Boost has been found (version=${Boost_VERSION}), Boost_TARGET=${Boost_Target}") + endif() endif (INTERNAL_BOOST) mark_as_advanced(Boost_INCLUDE_DIRS Boost_LIBRARIES)