Commit 67e56dcb authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

KStars now depends on libindi >= v0.8.0

parent 68c45328
......@@ -21,7 +21,7 @@ macro_log_feature(CFITSIO_FOUND "libcfitsio0" "Support for the FITS (Flexible Im
IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
macro_optional_find_package(INDI)
macro_bool_to_01(INDI_FOUND HAVE_INDI_H)
macro_log_feature(INDI_FOUND "libindi" "Support for controlling astronomical devices with KStars." "http://www.indilib.org" FALSE "0.6.2" "")
macro_log_feature(INDI_FOUND "libindi" "Support for controlling astronomical devices with KStars." "http://www.indilib.org" FALSE "0.8.0" "")
ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
check_include_files(linux/videodev2.h HAVE_LINUX_VIDEODEV2_H)
......
......@@ -4,21 +4,25 @@
# INDI_FOUND - system has INDI
# INDI_INCLUDE_DIR - the INDI include directory
# INDI_LIBRARIES - Link these to use INDI
# INDI_MAIN_LIBRARIES - Link to these to build INDI drivers with main()
# INDI_DRIVER_LIBRARIES - Link to these to build INDI drivers with indibase support
# INDI_CLIENT_LIBRARIES - Link to these to build INDI clients
# INDI_DATA_DIR - INDI shared data dir.
# Copyright (c) 2006, Jasem Mutlaq <mutlaqja@ikarustech.com>
# Copyright (c) 2011, Jasem Mutlaq <mutlaqja@ikarustech.com>
# Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
if (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
# in cache already
set(INDI_FOUND TRUE)
message(STATUS "Found INDI: ${INDI_LIBRARIES}")
else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
else (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
find_path(INDI_INCLUDE_DIR indidevapi.h
PATH_SUFFIXES libindi
......@@ -26,53 +30,53 @@ else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
${GNUWIN32_DIR}/include
)
find_path(INDI_DATA_DIR drivers.xml
PATHS /usr/share /usr/local/share /opt ${GNUWIN32_DIR}/share
PATH_SUFFIXES indi
)
find_library(INDI_LIBRARIES NAMES indi
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(INDI_DRIVER_LIBRARIES NAMES indidriver
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
find_library(INDI_LIBRARIES NAMES indi
find_library(INDI_MAIN_LIBRARIES NAMES indimain
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
find_library(INDI_CLIENT_LIBRARIES NAMES indiclient
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
)
if(INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
set(INDI_FOUND TRUE)
else (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
else (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
set(INDI_FOUND FALSE)
endif(INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
# Find pkg-config
FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
endif(INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
# query pkg-config asking for a libindi >= 0.6.2
EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.6.2 libindi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
if(_return_VALUE STREQUAL "0")
set(INDI_FOUND TRUE)
else(_return_VALUE STREQUAL "0")
set(INDI_FOUND FALSE)
message(STATUS "Could NOT find libindi. pkg-config indicates that libindi >= 0.6.2 is not installed.")
endif(_return_VALUE STREQUAL "0")
# Find INDI Server
FIND_PROGRAM(INDISERVER NAMES indiserver PATHS /usr/bin/ /usr/local/bin )
if (INDISERVER-NOTFOUND)
set(INDI_FOUND FALSE)
endif(INDISERVER-NOTFOUND)
if (INDI_FOUND)
if (INDI_FOUND)
if (NOT INDI_FIND_QUIETLY)
message(STATUS "Found INDI: ${INDI_LIBRARIES}, ${INDI_DRIVER_LIBRARIES}")
message(STATUS "Found INDI: ${INDI_LIBRARIES}, ${INDI_MAIN_LIBRARIES}")
message(STATUS "INDI Include: ${INDI_INCLUDE_DIR}, INDI Data: ${INDI_DATA_DIR}")
endif (NOT INDI_FIND_QUIETLY)
else (INDI_FOUND)
if (INDI_FIND_REQUIRED)
message(FATAL_ERROR "libindi and indiserver not found. Please install libindi and try again. http://www.indilib.org")
message(FATAL_ERROR "indi-dev not found. Cannot compile INDI drivers. Please install indi-dev and try again. http://www.indilib.org")
endif (INDI_FIND_REQUIRED)
endif (INDI_FOUND)
mark_as_advanced(INDI_INCLUDE_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES)
mark_as_advanced(INDI_INCLUDE_DIR INDI_DATA_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_MAIN_LIBRARIES INDI_CLIENT_LIBRARIES)
endif (INDI_INCLUDE_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES)
endif (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment