| 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 |
|
|---|
| 8 | # Copyright (c) 2006, Jasem Mutlaq <mutlaqja@ikarustech.com>
|
|---|
| 9 | # Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
|
|---|
| 10 | #
|
|---|
| 11 | # Redistribution and use is allowed according to the terms of the BSD license.
|
|---|
| 12 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|---|
| 13 |
|
|---|
| 14 | if (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 15 |
|
|---|
| 16 | # in cache already
|
|---|
| 17 | set(INDI_FOUND TRUE)
|
|---|
| 18 | message(STATUS "Found INDI: ${INDI_LIBRARIES}")
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 22 |
|
|---|
| 23 | find_path(INDI_INCLUDE_DIR indidevapi.h
|
|---|
| 24 | PATH_SUFFIXES libindi
|
|---|
| 25 | ${_obIncDir}
|
|---|
| 26 | ${GNUWIN32_DIR}/include
|
|---|
| 27 | )
|
|---|
| 28 |
|
|---|
| 29 | find_library(INDI_DRIVER_LIBRARIES NAMES indidriver
|
|---|
| 30 | PATHS
|
|---|
| 31 | ${_obLinkDir}
|
|---|
| 32 | ${GNUWIN32_DIR}/lib
|
|---|
| 33 | )
|
|---|
| 34 |
|
|---|
| 35 | find_library(INDI_LIBRARIES NAMES indi
|
|---|
| 36 | PATHS
|
|---|
| 37 | ${_obLinkDir}
|
|---|
| 38 | ${GNUWIN32_DIR}/lib
|
|---|
| 39 | )
|
|---|
| 40 |
|
|---|
| 41 | if(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 42 | set(INDI_FOUND TRUE)
|
|---|
| 43 | else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 44 | set(INDI_FOUND FALSE)
|
|---|
| 45 | endif(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 | if (INDI_FOUND)
|
|---|
| 49 | if (NOT INDI_FIND_QUIETLY)
|
|---|
| 50 | message(STATUS "Found INDI: ${INDI_LIBRARIES}, ${INDI_DRIVER_LIBRARIES}")
|
|---|
| 51 | endif (NOT INDI_FIND_QUIETLY)
|
|---|
| 52 | else (INDI_FOUND)
|
|---|
| 53 | if (INDI_FIND_REQUIRED)
|
|---|
| 54 | message(FATAL_ERROR "indi-devel not found. Cannot compile INDI drivers. Please install indi-devel and try again. http://indi.sf.net")
|
|---|
| 55 | endif (INDI_FIND_REQUIRED)
|
|---|
| 56 | endif (INDI_FOUND)
|
|---|
| 57 |
|
|---|
| 58 | mark_as_advanced(INDI_INCLUDE_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES)
|
|---|
| 59 |
|
|---|
| 60 | endif (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
|
|---|