mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
FindGSL: Fix gl_version.h extraction regex
Fix the regex to match versions with only two digits, such as `2.3`.
This commit is contained in:
committed by
Brad King
parent
1f8da86115
commit
88c4576be4
@@ -135,7 +135,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 ".*([0-9]\\.[0-9][0-9]?).*" "\\1" GSL_VERSION ${gsl_version_h_contents} )
|
||||
endif()
|
||||
|
||||
# might also try scraping the directory name for a regex match "gsl-X.X"
|
||||
|
||||
Reference in New Issue
Block a user