]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Also detect gsl version and export GSL_VERSION
authorMatthias Maier <tamiko@43-1.org>
Fri, 29 Jul 2016 01:38:59 +0000 (20:38 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 2 Aug 2016 00:00:04 +0000 (19:00 -0500)
cmake/modules/FindGSL.cmake

index 744d56677f87c93f71b0af75d867484b7d98f2f8..c84e829fa83ae7d7ed20391ec2adeaa4e610ca4f 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.