From d97d0e54a8a61c37ae7ade73f613da9cc18081ca Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 28 Jul 2016 20:38:59 -0500 Subject: [PATCH] CMake: Also detect gsl version and export GSL_VERSION --- cmake/modules/FindGSL.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.39.5