File: FindASI.cmake

package info (click to toggle)
libindi 1.7.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,580 kB
  • sloc: cpp: 100,576; ansic: 25,287; xml: 531; sh: 276; makefile: 9
file content (50 lines) | stat: -rw-r--r-- 1,307 bytes parent folder | download | duplicates (2)
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 ASI Library
# Once done this will define
#
#  ASI_FOUND - system has ASI
#  ASI_INCLUDE_DIR - the ASI include directory
#  ASI_LIBRARIES - Link these to use ASI

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

if (ASI_INCLUDE_DIR AND ASI_LIBRARIES)

  # in cache already
  set(ASI_FOUND TRUE)
  message(STATUS "Found libasi: ${ASI_LIBRARIES}")

else (ASI_INCLUDE_DIR AND ASI_LIBRARIES)

  find_path(ASI_INCLUDE_DIR ASICamera2.h
    PATH_SUFFIXES libasi
    ${_obIncDir}
    ${GNUWIN32_DIR}/include
  )

  find_library(ASI_LIBRARIES NAMES ASICamera2
    PATHS
    ${_obLinkDir}
    ${GNUWIN32_DIR}/lib
  )

  if(ASI_INCLUDE_DIR AND ASI_LIBRARIES)
    set(ASI_FOUND TRUE)
  else (ASI_INCLUDE_DIR AND ASI_LIBRARIES)
    set(ASI_FOUND FALSE)
  endif(ASI_INCLUDE_DIR AND ASI_LIBRARIES)


  if (ASI_FOUND)
    if (NOT ASI_FIND_QUIETLY)
      message(STATUS "Found ASI: ${ASI_LIBRARIES}")
    endif (NOT ASI_FIND_QUIETLY)
  else (ASI_FOUND)
    if (ASI_FIND_REQUIRED)
      message(FATAL_ERROR "ASI not found. Please install libasi http://www.indilib.org")
    endif (ASI_FIND_REQUIRED)
  endif (ASI_FOUND)

  mark_as_advanced(ASI_INCLUDE_DIR ASI_LIBRARIES)
  
endif (ASI_INCLUDE_DIR AND ASI_LIBRARIES)