mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-11-27 06:30:28 +08:00
check GSL version in cmake files
This commit is contained in:
parent
f6aa60bcf3
commit
4b09865b8f
@ -114,6 +114,17 @@ ELSE(WIN32)
|
||||
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>"
|
||||
# with <endchar> is a space or a semicolon
|
||||
|
@ -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})
|
||||
|
Loading…
Reference in New Issue
Block a user