Warning, /graphics/kst-plot/cmake/modules/FindGsl.cmake is written in an unsupported language. File is not indexed.
0001 # ***************************************************************************
0002 # * *
0003 # * Copyright : (C) 2010 The University of Toronto *
0004 # * email : netterfield@astro.utoronto.ca *
0005 # * *
0006 # * Copyright : (C) 2010 Peter Kümmel *
0007 # * email : syntheticpp@gmx.net *
0008 # * *
0009 # * This program is free software; you can redistribute it and/or modify *
0010 # * it under the terms of the GNU General Public License as published by *
0011 # * the Free Software Foundation; either version 2 of the License, or *
0012 # * (at your option) any later version. *
0013 # * *
0014 # ***************************************************************************
0015
0016 # use pkg to find the library name and paths,
0017 # but use this iformation in find_* only
0018 if(NOT GSL_INCLUDEDIR)
0019
0020 if(NOT kst_cross)
0021 include(FindPkgConfig)
0022 pkg_check_modules(PKGGSL QUIET gsl)
0023 endif()
0024
0025 if(NOT PKGGSL_LIBRARIES)
0026 set(PKGGSL_LIBRARIES gsl)
0027 if (UNIX AND NOT kst_cross)
0028 set(PKGGSL_LIBRARIES ${PKGGSL_LIBRARIES} m gslcblas)
0029 endif()
0030 endif()
0031
0032 set(GSL_INCLUDEDIR GSL_INCLUDEDIR-NOTFOUND CACHE STRING "" FORCE)
0033 find_path(GSL_INCLUDEDIR gsl_version.h
0034 HINTS
0035 ENV GSL_DIR
0036 PATH_SUFFIXES include/gsl include
0037 PATHS ${kst_3rdparty_dir} ${PKGGSL_INCLUDEDIR})
0038
0039 set(GSL_LIBRARY_LIST)
0040 foreach(it ${PKGGSL_LIBRARIES})
0041 set(lib lib-NOTFOUND CACHE STRING "" FORCE)
0042 FIND_LIBRARY(lib ${it}
0043 HINTS
0044 ENV GSL_DIR
0045 PATH_SUFFIXES lib
0046 PATHS ${kst_3rdparty_dir} ${PKGGSL_LIBRARY_DIRS})
0047 list(APPEND GSL_LIBRARY_LIST ${lib})
0048 endforeach()
0049 set(GSL_LIBRARIES ${GSL_LIBRARY_LIST} CACHE STRING "" FORCE)
0050
0051 endif()
0052
0053 if(GSL_INCLUDEDIR AND GSL_LIBRARIES)
0054 set(GSL_INCLUDE_DIR ${GSL_INCLUDEDIR} ${GSL_INCLUDEDIR}/..)
0055 set(gsl 1)
0056 message(STATUS "Found GSL:")
0057 message(STATUS " includes : ${GSL_INCLUDE_DIR}")
0058 message(STATUS " libraries: ${GSL_LIBRARIES}")
0059 else()
0060 message(STATUS "Not found: GSL.")
0061 MESSAGE(STATUS " If GSL is installed outside the CMake search path,")
0062 MESSAGE(STATUS " set the environmental variable GSL_DIR to the")
0063 MESSAGE(STATUS " GSL install prefix.")
0064 endif()
0065
0066 message(STATUS "")
0067