2 # This module finds if GSL is installed and determines where the
3 # include files and libraries are. It also determines what the name of
4 # the library is. This code sets the following variables:
6 # GSL_FOUND = system has GSL and it should be used
7 # GSL_LIBRARIES = full path to the GSL library and linker flags on unix
8 # CMAKE_GSL_CXX_FLAGS = compiler flags for building GSL
9 # GSL_INCLUDE_DIR = include path of GSL
14 FIND_PROGRAM(CMAKE_GSL_CONFIG gsl-config ../GSL/bin ../../GSL/bin)
15 SET(CMAKE_GSL_CXX_FLAGS "`${CMAKE_GSL_CONFIG} --cflags`")
16 SET(GSL_LIBRARIES "`${CMAKE_GSL_CONFIG} --libs`")
20 SET (GSL_POSSIBLE_LIB_PATHS
22 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GNU Scientific Library_is1;Inno Setup: App Path]/lib"
25 FIND_LIBRARY(GSL_STATIC_LIBRARY
27 PATHS ${GSL_POSSIBLE_LIB_PATHS}
30 FIND_LIBRARY(GSL_SHARED_LIBRARY
32 PATHS ${GSL_POSSIBLE_LIB_PATHS}
35 SET (GSL_POSSIBLE_INCLUDE_PATHS
37 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\GNU Scientific Library_is1;Inno Setup: App Path]/include"
40 FIND_PATH(GSL_INCLUDE_DIR
42 ${GSL_POSSIBLE_INCLUDE_PATHS}
45 IF(GSL_SHARED_LIBRARY)
46 OPTION(GSL_USE_SHARED_LIBS
47 "Use shared versions of GSL libraries" ON)
48 MARK_AS_ADVANCED(GSL_USE_SHARED_LIBS)
49 ENDIF(GSL_SHARED_LIBRARY)
51 SET(CMAKE_GSL_LIBRARIES ${CMAKE_GSL_LIBRARIES}) # comctl32 ctl3d32 wsock32 rpcrt4)
53 IF(GSL_USE_SHARED_LIBS)
54 SET(GSL_LIBRARIES ${GSL_SHARED_LIBRARY} ${CMAKE_GSL_LIBRARIES})
55 ELSE(GSL_USE_SHARED_LIBS)
56 SET(GSL_LIBRARIES ${GSL_STATIC_LIBRARY} ${CMAKE_GSL_LIBRARIES})
57 ENDIF(GSL_USE_SHARED_LIBS)
67 FIND_PROGRAM(CMAKE_GSL_CONFIG gsl-config ../GSL/bin ../../GSL/bin)
68 SET(CMAKE_GSL_CXX_FLAGS "`${CMAKE_GSL_CONFIG} --cflags`")
69 SET(GSL_LIBRARIES "`${CMAKE_GSL_CONFIG} --libs`")
80 IF(GSL_INCLUDE_DIR OR CMAKE_GSL_CXX_FLAGS)
81 SET(CMAKE_GSL_CAN_COMPILE 1)
83 ENDIF(GSL_INCLUDE_DIR OR CMAKE_GSL_CXX_FLAGS)