diff --git a/SuperBuild/CMake/SystemCheckup.cmake b/SuperBuild/CMake/SystemCheckup.cmake index a2f652332a9f04bd9d4dc0672f3c87ba935b74e1..a6a2d06e6e3d61c5da771e9387cecb5793f50023 100644 --- a/SuperBuild/CMake/SystemCheckup.cmake +++ b/SuperBuild/CMake/SystemCheckup.cmake @@ -18,12 +18,12 @@ macro(SB_CHECKUP_FIND_PACKAGE var) set(_SB_CHECKUP_${_uppervar}_VERSION NOTFOUND) set(_SB_CHECKUP_${_uppervar}_FOUND FALSE) set(_SB_CHECKUP_${_uppervar}_NAME NOTFOUND) - if(${var}_FOUND) - set(_SB_CHECKUP_${_uppervar}_FOUND TRUE) - set(_SB_CHECKUP_${_uppervar}_NAME ${var}) - elseif(${_uppervar}_FOUND) + if(${_uppervar}_FOUND) set(_SB_CHECKUP_${_uppervar}_FOUND TRUE) set(_SB_CHECKUP_${_uppervar}_NAME ${_uppervar}) + elseif(${var}_FOUND) + set(_SB_CHECKUP_${_uppervar}_FOUND TRUE) + set(_SB_CHECKUP_${_uppervar}_NAME ${var}) endif() if(_SB_CHECKUP_${_uppervar}_FOUND) @@ -31,16 +31,12 @@ macro(SB_CHECKUP_FIND_PACKAGE var) message(STATUS "|------------------------------------------------") message(STATUS "|${var} found") if(DEFINED ${_var_name}_VERSION) - message(STATUS "| version = ${${_var_name}_VERSION}") set(_SB_CHECKUP_${_uppervar}_VERSION ${${_var_name}_VERSION}) elseif(DEFINED ${_var_name}_VERSION_STRING) - message(STATUS "| version = ${${_var_name}_VERSION_STRING}") set(_SB_CHECKUP_${_uppervar}_VERSION ${${_var_name}_VERSION_STRING}) elseif(DEFINED ${_var_name}_VERSION_MAJOR AND DEFINED ${_var_name}_VERSION_MINOR AND DEFINED ${_var_name}_VERSION_PATCH) - message(STATUS "| version = ${${_var_name}_VERSION_MAJOR}.${${_var_name}_VERSION_MINOR}.${${_var_name}_VERSION_PATCH}") set(_SB_CHECKUP_${_uppervar}_VERSION "${${_var_name}_VERSION_MAJOR}.${${_var_name}_VERSION_MINOR}.${${_var_name}_VERSION_PATCH}") elseif(DEFINED ${_var_name}_MAJOR_VERSION AND DEFINED ${_var_name}_MINOR_VERSION AND DEFINED ${_var_name}_BUILD_VERSION) - message(STATUS "| version = ${${_var_name}_MAJOR_VERSION}.${${_var_name}_MINOR_VERSION}.${${_var_name}_BUILD_VERSION}") set(_SB_CHECKUP_${_uppervar}_VERSION "${${_var_name}_MAJOR_VERSION}.${${_var_name}_MINOR_VERSION}.${${_var_name}_BUILD_VERSION}") endif() @@ -48,6 +44,10 @@ macro(SB_CHECKUP_FIND_PACKAGE var) if(_SB_CHECKUP_${_uppervar}_VERSION MATCHES "^[0-9]+\\.[0-9]+\$") set(_SB_CHECKUP_${_uppervar}_VERSION "${_SB_CHECKUP_${_uppervar}_VERSION}.0") endif() + # display version number + if(_SB_CHECKUP_${_uppervar}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\$") + message(STATUS "| version = ${_SB_CHECKUP_${_uppervar}_VERSION}") + endif() endif() endmacro(SB_CHECKUP_FIND_PACKAGE) @@ -100,8 +100,13 @@ endmacro(SB_CHECKUP_FIND_VERSIONS) # Boost SB_CHECKUP_FIND_PACKAGE(Boost) -if(_SB_CHECKUP_BOOST_VERSION) +if(_SB_CHECKUP_BOOST_VERSION MATCHES "^[0-9]+\$") set(_SB_CHECKUP_BOOST_VERSION_NUMBER ${_SB_CHECKUP_BOOST_VERSION}) + math(EXPR _SB_CHECKUP_BOOST_VERSION_PATCH "(${_SB_CHECKUP_BOOST_VERSION_NUMBER})%100") + math(EXPR _SB_CHECKUP_BOOST_VERSION_MINOR "((${_SB_CHECKUP_BOOST_VERSION_NUMBER})/100)%1000") + math(EXPR _SB_CHECKUP_BOOST_VERSION_MAJOR "(${_SB_CHECKUP_BOOST_VERSION_NUMBER})/100000") + set(_SB_CHECKUP_BOOST_VERSION "${_SB_CHECKUP_BOOST_VERSION_MAJOR}.${_SB_CHECKUP_BOOST_VERSION_MINOR}.${_SB_CHECKUP_BOOST_VERSION_PATCH}") + message(STATUS "| version = ${_SB_CHECKUP_BOOST_VERSION}") endif() # Curl