From: Matthias Maier Date: Fri, 16 Aug 2013 21:32:45 +0000 (+0000) Subject: CMake: Unify version variables X-Git-Tag: v8.1.0~1055 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04a1a6cfe1a58c7787fa6c2320fae3a091a42f04;p=dealii.git CMake: Unify version variables git-svn-id: https://svn.dealii.org/trunk@30319 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/configure/configure_2_metis.cmake b/deal.II/cmake/configure/configure_2_metis.cmake index 92a1f10880..8d83b9661d 100644 --- a/deal.II/cmake/configure/configure_2_metis.cmake +++ b/deal.II/cmake/configure/configure_2_metis.cmake @@ -22,7 +22,7 @@ MACRO(FEATURE_METIS_FIND_EXTERNAL var) FIND_PACKAGE(METIS) IF(METIS_FOUND) - IF(METIS_MAJOR GREATER 4) + IF(METIS_VERSION_MAJOR GREATER 4) SET(${var} TRUE) ELSE() MESSAGE(STATUS "Insufficient metis installation found: " diff --git a/deal.II/cmake/modules/FindMETIS.cmake b/deal.II/cmake/modules/FindMETIS.cmake index f0cfa9eba7..80cbd97d47 100644 --- a/deal.II/cmake/modules/FindMETIS.cmake +++ b/deal.II/cmake/modules/FindMETIS.cmake @@ -21,6 +21,9 @@ # # METIS_LIBRARIES # METIS_INCLUDE_DIRS +# METIS_VERSION +# METIS_VERSION_MAJOR +# METIS_VERSION_MINOR # INCLUDE(FindPackageHandleStandardArgs) @@ -87,13 +90,27 @@ IF(METIS_FOUND) # # Extract the version number out of metis.h # - FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MAJOR_STRING - REGEX "METIS_VER_MAJOR") - STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_MAJOR "${METIS_MAJOR_STRING}") - - FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MINOR_STRING - REGEX "METIS_VER_MINOR") - STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_MINOR "${METIS_MINOR_STRING}") + FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_major_string + REGEX "METIS_VER_MAJOR" + ) + STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" + METIS_VERSION_MAJOR "${_metis_major_string}" + ) + FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_minor_string + REGEX "METIS_VER_MINOR" + ) + STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" + METIS_VERSION_MINOR "${_metis_minor_string}" + ) + FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_subminor_string + REGEX "METIS_VER_SUBMINOR" + ) + STRING(REGEX REPLACE "^.*METIS_VER_SUBMINOR.* ([0-9]+).*" "\\1" + METIS_VERSION_SUBMINOR "${_metis_subminor_string}" + ) + SET(METIS_VERSION + "${METIS_VERSION_MAJOR}.${METIS_VERSION_MINOR}.${METIS_VERSION_SUBMINOR}" + ) MARK_AS_ADVANCED(METIS_DIR) ELSE()