diff --git a/moose-core/VERSION b/moose-core/VERSION index 800a76275f15c77c76a87df29c46bcae05377b48..50e47c89cafc3ec95774b3110a3dba45256d0b24 100644 --- a/moose-core/VERSION +++ b/moose-core/VERSION @@ -1 +1 @@ -3.1.1-47-gf27beb9 \ No newline at end of file +3.1.1 \ No newline at end of file diff --git a/moose-core/cmake_modules/FindGSL.cmake b/moose-core/cmake_modules/FindGSL.cmake index b08eded1f916ea97e2af42415762b2cef07b1f3c..013a9c81e1f11f2b6b58be561b1f7690f4e3c0ab 100644 --- a/moose-core/cmake_modules/FindGSL.cmake +++ b/moose-core/cmake_modules/FindGSL.cmake @@ -4,8 +4,9 @@ # # GSL_FOUND = system has GSL lib # -# GSL_LIBRARIES = full path to the libraries -# on Unix/Linux with additional linker flags from "gsl-config --libs" +# GSL_VERSION = gsl version +# +# GSL_LIBRARIES = name of the libraries. # # GSL_INCLUDE_DIRS = where to find headers # @@ -73,7 +74,7 @@ ELSE(WIN32) /opt/lib /opt/lib64 ) - FIND_PATH(GSL_INCLUDE_DIRS NAMES gsl/gsl_blas.h gsl/gsl.h + FIND_PATH(GSL_INCLUDE_DIRS NAMES gsl/gsl_blas.h PATHS $ENV{GSL_ROOT_DIR}/include $ENV{GSL_ROOT_DIR}/include /opt/include /opt/include @@ -85,11 +86,18 @@ ELSE(WIN32) ENDIF(WIN32) +# FIND version +file(READ "${GSL_INCLUDE_DIRS}/gsl/gsl_version.h" GSL_VERSION_TEXT) +string(REGEX REPLACE ".*define[ ]+GSL_MAJOR_VERSION[ ]*([0-9]+).*" "\\1" + GSL_MAJOR_VERSION "${GSL_VERSION_TEXT}") +string(REGEX REPLACE ".*define[ ]+GSL_MINOR_VERSION[ ]*([0-9]+).*" "\\1" + GSL_MINOR_VERSION "${GSL_VERSION_TEXT}") +set(GSL_VERSION "${GSL_MAJOR_VERSION}.${GSL_MINOR_VERSION}") -IF(GSL_LIBRARIES) - IF(GSL_INCLUDE_DIRS OR GSL_CXX_FLAGS) +IF(GSL_LIBRARIES AND GSL_VERSION) + IF(GSL_INCLUDE_DIRS) SET(GSL_FOUND 1) MESSAGE(STATUS "Found GSL ${GSL_LIBRARIES}") - ENDIF(GSL_INCLUDE_DIRS OR GSL_CXX_FLAGS) -ENDIF(GSL_LIBRARIES) + ENDIF(GSL_INCLUDE_DIRS) +ENDIF()