From: Matthias Maier Date: Fri, 29 Jul 2016 01:38:59 +0000 (-0500) Subject: CMake: Also detect gsl version and export GSL_VERSION X-Git-Tag: v8.5.0-rc1~813^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d97d0e54a8a61c37ae7ade73f613da9cc18081ca;p=dealii.git CMake: Also detect gsl version and export GSL_VERSION --- diff --git a/cmake/modules/FindGSL.cmake b/cmake/modules/FindGSL.cmake index 744d56677f..c84e829fa8 100644 --- a/cmake/modules/FindGSL.cmake +++ b/cmake/modules/FindGSL.cmake @@ -22,6 +22,7 @@ # GSL_LIBRARIES # GSL_INCLUDE_DIRS # GSL_LINKER_FLAGS +# GSL_VERSION # # @@ -60,6 +61,15 @@ DEAL_II_FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h PATH_SUFFIXES include ) +IF(EXISTS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" ) + FILE(STRINGS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" GSL_VERSION_STRING_LINE + REGEX "#define GSL_VERSION" + ) + STRING(REGEX REPLACE ".*([0-9].[0-9]+).*" "\\1" GSL_VERSION + "${GSL_VERSION_STRING_LINE}" + ) +ENDIF() + DEAL_II_PACKAGE_HANDLE(GSL LIBRARIES REQUIRED GSL_LIBRARY