source: BAORadio/libindi/libindi/cmake_modules/FindINDI.cmake @ 642

Last change on this file since 642 was 642, checked in by frichard, 12 years ago

-Alignement des antennes
-Version 0.0.9 de libindi

File size: 2.7 KB
Line 
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_MAIN_LIBRARIES - Link to these to build INDI drivers with main()
8#  INDI_DRIVER_LIBRARIES - Link to these to build INDI drivers with indibase support
9#  INDI_CLIENT_LIBRARIES - Link to these to build INDI clients
10#  INDI_DATA_DIR - INDI shared data dir.
11
12# Copyright (c) 2011, Jasem Mutlaq <mutlaqja@ikarustech.com>
13# Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
14#
15# Redistribution and use is allowed according to the terms of the BSD license.
16# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17
18if (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
19
20  # in cache already
21  set(INDI_FOUND TRUE)
22  message(STATUS "Found INDI: ${INDI_LIBRARIES}")
23
24
25else (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
26
27  find_path(INDI_INCLUDE_DIR indidevapi.h
28    PATH_SUFFIXES libindi
29    ${_obIncDir}
30    ${GNUWIN32_DIR}/include
31  )
32
33 find_path(INDI_DATA_DIR drivers.xml
34    PATHS /usr/share /usr/local/share /opt ${GNUWIN32_DIR}/share
35    PATH_SUFFIXES indi
36  )
37
38  find_library(INDI_LIBRARIES NAMES indi
39    PATHS
40    ${_obLinkDir}
41    ${GNUWIN32_DIR}/lib
42  )
43
44  find_library(INDI_DRIVER_LIBRARIES NAMES indidriver
45    PATHS
46    ${_obLinkDir}
47    ${GNUWIN32_DIR}/lib
48  )
49
50  find_library(INDI_MAIN_LIBRARIES NAMES indimain
51    PATHS
52    ${_obLinkDir}
53    ${GNUWIN32_DIR}/lib
54  )
55
56  find_library(INDI_CLIENT_LIBRARIES NAMES indiclient
57    PATHS
58    ${_obLinkDir}
59    ${GNUWIN32_DIR}/lib
60  )
61
62  # Find pkg-config
63  FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
64
65  # query pkg-config asking for a libindi >= 0.8.0
66     EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.8.0 libindi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
67     if(_return_VALUE STREQUAL "0")
68        set(INDI_FOUND TRUE)
69     else(_return_VALUE STREQUAL "0")
70       set(INDI_FOUND FALSE)
71       message(STATUS "Could NOT find libindi. pkg-config indicates that libindi >= 0.8.0 is not installed.")
72     endif(_return_VALUE STREQUAL "0")
73
74
75  if (INDI_FOUND)
76    if (NOT INDI_FIND_QUIETLY)
77      message(STATUS "Found INDI: ${INDI_LIBRARIES}, ${INDI_MAIN_LIBRARIES}")
78      message(STATUS "INDI Include: ${INDI_INCLUDE_DIR}, INDI Data: ${INDI_DATA_DIR}")
79    endif (NOT INDI_FIND_QUIETLY)
80  endif (INDI_FOUND)
81
82  mark_as_advanced(INDI_INCLUDE_DIR INDI_DATA_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_MAIN_LIBRARIES INDI_CLIENT_LIBRARIES)
83
84endif (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
Note: See TracBrowser for help on using the repository browser.