summaryrefslogtreecommitdiffstats
path: root/cmake_modules/FindDC1394.cmake
blob: 87d96097df074c8461229bf3024eb740aae51480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# - Try to find dc1394 library (version 2) and include files
# Once done this will define
#
#  DC1394_FOUND - system has DC1394
#  DC1394_INCLUDE_DIR - the DC1394 include directory
#  DC1394_LIBRARIES - Link these to use DC1394

# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)

  # in cache already
  set(DC1394_FOUND TRUE)
  message(STATUS "Found libdc1394: ${DC1394_LIBRARIES}")

else (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)

  find_path(DC1394_INCLUDE_DIR control.h
    PATH_SUFFIXES dc1394
    ${_obIncDir}
    ${GNUWIN32_DIR}/include
  )

  find_library(DC1394_LIBRARIES NAMES dc1394
    PATHS
    ${_obLinkDir}
    ${GNUWIN32_DIR}/lib
  )

  if(DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
    set(DC1394_FOUND TRUE)
  else (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)
    set(DC1394_FOUND FALSE)
  endif(DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)


  if (DC1394_FOUND)
    if (NOT DC1394_FIND_QUIETLY)
      message(STATUS "Found DC1394: ${DC1394_LIBRARIES}")
    endif (NOT DC1394_FIND_QUIETLY)
  else (DC1394_FOUND)
    if (DC1394_FIND_REQUIRED)
      message(FATAL_ERROR "DC1394 not found. Please install libdc1394 development package.")
    endif (DC1394_FIND_REQUIRED)
  endif (DC1394_FOUND)

  mark_as_advanced(DC1394_INCLUDE_DIR DC1394_LIBRARIES)

endif (DC1394_INCLUDE_DIR AND DC1394_LIBRARIES)