فهرست منبع

Merge branch 'FindGSL-version-regex' into release-3.22

Merge-request: !6960
Brad King 3 سال پیش
والد
کامیت
b91c4dfb75
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Modules/FindGSL.cmake

+ 1 - 1
Modules/FindGSL.cmake

@@ -139,7 +139,7 @@ if( NOT GSL_VERSION )
   # 2. If gsl-config is not available, try looking in gsl/gsl_version.h
   if( NOT GSL_VERSION AND EXISTS "${GSL_INCLUDE_DIRS}/gsl/gsl_version.h" )
     file( STRINGS "${GSL_INCLUDE_DIRS}/gsl/gsl_version.h" gsl_version_h_contents REGEX "define GSL_VERSION" )
-    string( REGEX REPLACE ".*([0-9]\\.[0-9][0-9]?).*" "\\1" GSL_VERSION ${gsl_version_h_contents} )
+    string( REGEX REPLACE ".*define[ ]+GSL_VERSION[ ]+\"([^\"]*)\".*" "\\1" GSL_VERSION ${gsl_version_h_contents} )
   endif()
 
   # might also try scraping the directory name for a regex match "gsl-X.X"