summaryrefslogtreecommitdiffstats
path: root/cmake_modules/FindQSI.cmake
blob: afaac6d00caf61b23e99e61c05c1c6bbda610137 (plain)
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
# - Try to find Quantum Scientific Imaging Library
# Once done this will define
#
#  QSI_FOUND - system has QSI
#  QSI_INCLUDE_DIR - the QSI include directory
#  QSI_LIBRARIES - Link these to use QSI

# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (QSI_INCLUDE_DIR AND QSI_LIBRARIES)

  # in cache already
  set(QSI_FOUND TRUE)
  message(STATUS "Found libqsiapi: ${QSI_LIBRARIES}")

else (QSI_INCLUDE_DIR AND QSI_LIBRARIES)

  find_path(QSI_INCLUDE_DIR qsiapi.h
    PATH_SUFFIXES qsiapi
    ${_obIncDir}
    ${GNUWIN32_DIR}/include
  )

  find_library(QSI_LIBRARIES NAMES qsiapi
    PATHS
    ${_obLinkDir}
    ${GNUWIN32_DIR}/lib
  )

  if(QSI_INCLUDE_DIR AND QSI_LIBRARIES)
    set(QSI_FOUND TRUE)
  else (QSI_INCLUDE_DIR AND QSI_LIBRARIES)
    set(QSI_FOUND FALSE)
  endif(QSI_INCLUDE_DIR AND QSI_LIBRARIES)


  if (QSI_FOUND)
    if (NOT QSI_FIND_QUIETLY)
      message(STATUS "Found QSI: ${QSI_LIBRARIES}")
    endif (NOT QSI_FIND_QUIETLY)
  else (QSI_FOUND)
    if (QSI_FIND_REQUIRED)
      message(FATAL_ERROR "QSI not found. Please install libqsi http://www.indilib.org")
    endif (QSI_FIND_REQUIRED)
  endif (QSI_FOUND)

  mark_as_advanced(QSI_INCLUDE_DIR QSI_LIBRARIES)
  
endif (QSI_INCLUDE_DIR AND QSI_LIBRARIES)