source: BAORadio/libindi/v1.0.1/cmake_modules/FindGPHOTO2.cmake@ 608

Last change on this file since 608 was 490, checked in by campagne, 15 years ago

import libindi (JEC)

File size: 1.6 KB
Line 
1# - Try to find libgphoto2
2# Once done this will define
3#
4# LIBGPHOTO2_FOUND - system has libgphoto2
5# LIBGPHOTO2_INCLUDE_DIR - the libgphoto2 include directory
6# LIBGPHOTO2_LIBRARIES - Link these to use libghoto2
7
8# Copyright (c) 2009, Geoffrey Hausheer
9# Based on FindINDI by Jasem Mutlaq <mutlaqja@ikarustech.com>
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
14if (LIBGPHOTO2_INCLUDE_DIR AND LIBGPHOTO2_LIBRARIES)
15
16 # in cache already
17 set(LIBGPHOTO2_FOUND TRUE)
18 message(STATUS "Found libgphoto2: ${LIBGPHOTO2_LIBRARIES}")
19
20
21else (LIBGPHOTO2_INCLUDE_DIR AND LIBGPHOTO2_LIBRARIES)
22
23 find_path(LIBGPHOTO2_INCLUDE_DIR gphoto2.h
24 PATH_SUFFIXES gphoto2
25 ${_obIncDir}
26 ${GNUWIN32_DIR}/include
27 )
28
29 find_library(LIBGPHOTO2_LIBRARIES NAMES gphoto2
30 PATHS
31 ${_obLinkDir}
32 ${GNUWIN32_DIR}/lib
33 )
34
35 if(LIBGPHOTO2_INCLUDE_DIR AND LIBGPHOTO2_LIBRARIES)
36 set(LIBGPHOTO2_FOUND TRUE)
37 else (LIBGPHOTO2_INCLUDE_DIR AND LIBGPHOTO2_LIBRARIES)
38 set(LIBGPHOTO2_FOUND FALSE)
39 endif(LIBGPHOTO2_INCLUDE_DIR AND LIBGPHOTO2_LIBRARIES)
40
41
42 if (LIBGPHOTO2_FOUND)
43 if (NOT LIBGPHOTO2_FIND_QUIETLY)
44 message(STATUS "Found libgphoto2: ${LIBGPHOTO2_LIBRARIES}")
45 endif (NOT LIBGPHOTO2_FIND_QUIETLY)
46 else (LIBGPHOTO2_FOUND)
47 if (GLIBPHOTO2_FIND_REQUIRED)
48 message(FATAL_ERROR "libgphoto2 not found.")
49 endif (LIBGPHOTO2_FIND_REQUIRED)
50 endif (LIBGPHOTO2_FOUND)
51
52 mark_as_advanced(LIBGPHOTO2_INCLUDE_DIR LIBGPHOTO2_LIBRARIES)
53
54endif (LIBGPHOTO2_INCLUDE_DIR AND LIBGPHOTO2_LIBRARIES)
Note: See TracBrowser for help on using the repository browser.