mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 03:09:01 +08:00
check GSL version in cmake files
This commit is contained in:
parent
f6aa60bcf3
commit
4b09865b8f
@ -113,6 +113,17 @@ ELSE(WIN32)
|
|||||||
EXEC_PROGRAM(${GSL_CONFIG}
|
EXEC_PROGRAM(${GSL_CONFIG}
|
||||||
ARGS --libs
|
ARGS --libs
|
||||||
OUTPUT_VARIABLE GSL_CONFIG_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)
|
# split off the link dirs (for rpath)
|
||||||
# use regular expression to match wildcard equivalent "-L*<endchar>"
|
# use regular expression to match wildcard equivalent "-L*<endchar>"
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
find_package(GSL)
|
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)
|
if(GSL_FOUND)
|
||||||
add_definitions("-DHAS_GSL" ${GSL_DEFINITIONS})
|
add_definitions("-DHAS_GSL" ${GSL_DEFINITIONS})
|
||||||
include_directories(${GSL_INCLUDE_DIR})
|
include_directories(${GSL_INCLUDE_DIR})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user