| 1 | # - Try to find INDI
|
|---|
| 2 | # Once done this will define
|
|---|
| 3 | #
|
|---|
| 4 | # INDI_FOUND - system has INDI
|
|---|
| 5 | # INDI_INCLUDE_DIR - the INDI include directory
|
|---|
| 6 | # INDI_LIBRARIES - Link these to use INDI
|
|---|
| 7 | # INDI_DEVICE_LIBRARY - The indi default device library
|
|---|
| 8 | # INDI_DATA_DIR - INDI shared data dir.
|
|---|
| 9 |
|
|---|
| 10 | # Copyright (c) 2010, Jasem Mutlaq <mutlaqja@ikarustech.com>
|
|---|
| 11 | # Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
|
|---|
| 12 | #
|
|---|
| 13 | # Redistribution and use is allowed according to the terms of the BSD license.
|
|---|
| 14 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|---|
| 15 |
|
|---|
| 16 | if (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 17 |
|
|---|
| 18 | # in cache already
|
|---|
| 19 | set(INDI_FOUND TRUE)
|
|---|
| 20 | message(STATUS "Found INDI: ${INDI_LIBRARIES}")
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 24 |
|
|---|
| 25 | find_path(INDI_INCLUDE_DIR indidevapi.h
|
|---|
| 26 | PATH_SUFFIXES libindi
|
|---|
| 27 | ${_obIncDir}
|
|---|
| 28 | ${GNUWIN32_DIR}/include
|
|---|
| 29 | )
|
|---|
| 30 |
|
|---|
| 31 | find_path(INDI_DATA_DIR drivers.xml
|
|---|
| 32 | PATH_SUFFIXES indi
|
|---|
| 33 | /usr
|
|---|
| 34 | /usr/local
|
|---|
| 35 | /opt
|
|---|
| 36 | ${GNUWIN32_DIR}/share
|
|---|
| 37 | )
|
|---|
| 38 |
|
|---|
| 39 | find_library(INDI_DRIVER_LIBRARIES NAMES indidriver
|
|---|
| 40 | PATHS
|
|---|
| 41 | ${_obLinkDir}
|
|---|
| 42 | ${GNUWIN32_DIR}/lib
|
|---|
| 43 | )
|
|---|
| 44 |
|
|---|
| 45 | find_library(INDI_DEVICE_LIBRARIES NAMES indidefaultdevice
|
|---|
| 46 | PATHS
|
|---|
| 47 | ${_obLinkDir}
|
|---|
| 48 | ${GNUWIN32_DIR}/lib
|
|---|
| 49 | )
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | find_library(INDI_LIBRARIES NAMES indi
|
|---|
| 53 | PATHS
|
|---|
| 54 | ${_obLinkDir}
|
|---|
| 55 | ${GNUWIN32_DIR}/lib
|
|---|
| 56 | )
|
|---|
| 57 |
|
|---|
| 58 | if(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 59 | set(INDI_FOUND TRUE)
|
|---|
| 60 | else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 61 | set(INDI_FOUND FALSE)
|
|---|
| 62 | endif(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 | if (INDI_FOUND)
|
|---|
| 66 | if (NOT INDI_FIND_QUIETLY)
|
|---|
| 67 | message(STATUS "Found INDI: ${INDI_LIBRARIES}, ${INDI_DRIVER_LIBRARIES}")
|
|---|
| 68 | endif (NOT INDI_FIND_QUIETLY)
|
|---|
| 69 | else (INDI_FOUND)
|
|---|
| 70 | if (INDI_FIND_REQUIRED)
|
|---|
| 71 | message(FATAL_ERROR "indi-devel not found. Cannot compile INDI drivers. Please install indi-devel and try again. http://www.indilib.org")
|
|---|
| 72 | endif (INDI_FIND_REQUIRED)
|
|---|
| 73 | endif (INDI_FOUND)
|
|---|
| 74 |
|
|---|
| 75 | mark_as_advanced(INDI_INCLUDE_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_DEVICE_LIBRARIES INDI_DATA_DIR)
|
|---|
| 76 |
|
|---|
| 77 | endif (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|