aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cmake/FindGSL.cmake11
-rw-r--r--test/CMakeLists.txt3
2 files changed, 14 insertions, 0 deletions
diff --git a/cmake/FindGSL.cmake b/cmake/FindGSL.cmake
index 57509f774..bf411a7f9 100644
--- a/cmake/FindGSL.cmake
+++ b/cmake/FindGSL.cmake
@@ -113,6 +113,17 @@ ELSE(WIN32)
EXEC_PROGRAM(${GSL_CONFIG}
ARGS --libs
OUTPUT_VARIABLE GSL_CONFIG_LIBS )
+
+ # extract version
+ EXEC_PROGRAM(${GSL_CONFIG}
+ ARGS --version
+ OUTPUT_VARIABLE GSL_FULL_VERSION )
+
+ # split version as major/minor
+ STRING(REGEX MATCH "(.)\\..*" GSL_VERSION_MAJOR_ "${GSL_FULL_VERSION}")
+ SET(GSL_VERSION_MAJOR ${CMAKE_MATCH_1})
+ STRING(REGEX MATCH ".\\.(.*)" GSL_VERSION_MINOR_ "${GSL_FULL_VERSION}")
+ SET(GSL_VERSION_MINOR ${CMAKE_MATCH_1})
# split off the link dirs (for rpath)
# use regular expression to match wildcard equivalent "-L*<endchar>"
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8f44d3aff..f3c7454e3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,5 +1,8 @@
find_package(GSL)
+if(GSL_FOUND AND GSL_VERSION_MINOR LESS 9)
+ set(GSL_FOUND "")
+endif(GSL_FOUND AND GSL_VERSION_MINOR LESS 9)
if(GSL_FOUND)
add_definitions("-DHAS_GSL" ${GSL_DEFINITIONS})
include_directories(${GSL_INCLUDE_DIR})