File: FindGSL.cmake

package info (click to toggle)
luminance-hdr 2.6.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 34,700 kB
  • sloc: cpp: 43,912; ansic: 4,122; xml: 116; makefile: 20; sh: 7
file content (64 lines) | stat: -rw-r--r-- 1,765 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# - Find GSL
# Find the GNU Scientific Library (GSL) includes and library
#
# This module defines
#  GSL_FOUND
#  GSL_LIBRARIES for GSL only
#  GSLCBLAS_LIBRARIES for GSL CBLAS
#  GSL_INCLUDE_DIR
#  GSLCBLAS_INCLUDE_DIR (not yet defined)
#

FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_rng.h
  /usr/local/include
  /usr/include
  /opt/local/include
)

FIND_PATH(GSLCBLAS_INCLUDE_DIR gsl/gsl_cblas.h
  /usr/local/include
  /usr/include
  /opt/local/include
)

IF(GSL_USE_STATIC_LIBS)
  SET( _GSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  IF(WIN32)
    SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  ELSE(WIN32)
    SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  ENDIF(WIN32)
ENDIF(GSL_USE_STATIC_LIBS)

FIND_LIBRARY(GSL_LIBRARY NAMES gsl)
FIND_LIBRARY(GSL_CBLAS_LIBRARY NAMES gslcblas)

IF(GSL_USE_STATIC_LIBS)
  SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_GSL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
ENDIF(GSL_USE_STATIC_LIBS)

IF(GSL_LIBRARY AND GSL_CBLAS_LIBRARY AND GSL_INCLUDE_DIR AND GSLCBLAS_INCLUDE_DIR)
  SET(GSL_LIBRARIES ${GSL_LIBRARY})
  SET(GSLCBLAS_LIBRARIES ${GSL_CBLAS_LIBRARY})
  SET(GSL_FOUND "YES")
ELSE()
  SET(GSL_FOUND "NO")
ENDIF()

IF(GSL_FOUND)
  IF(NOT GSL_FIND_QUIETLY)
    MESSAGE(STATUS "Found GNU Scientific Library (GSL_LIBRARY = ${GSL_LIBRARY})")
    MESSAGE(STATUS "Found GNU Scientific Library: (GSL_CBLAS_LIBRARY = ${GSL_CBLAS_LIBRARY})")
    MESSAGE(STATUS "Found GNU Scientific Library: (GSL_INCLUDE_DIR = ${GSL_INCLUDE_DIR})")
  ENDIF(NOT GSL_FIND_QUIETLY)
ELSE(GSL_FOUND)
  IF(GSL_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could not find GNU Scientific Library")
  ENDIF(GSL_FIND_REQUIRED)
ENDIF(GSL_FOUND)

MARK_AS_ADVANCED(
  GSL_LIBRARY
  GSL_CBLAS_LIBRARY
  GSL_INCLUDE_DIR
)