File: FindEXIF.cmake

package info (click to toggle)
pfstools 2.2.0-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,548 kB
  • sloc: cpp: 26,364; javascript: 3,814; ansic: 999; sh: 180; python: 65; makefile: 47
file content (71 lines) | stat: -rw-r--r-- 1,776 bytes parent folder | download | duplicates (14)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# - Try to find EXIF
# Once done this will define
#
#  EXIF_FOUND - system has EXIF
#  EXIF_INCLUDE_DIRS - the EXIF include directory
#  EXIF_LIBRARIES - Link these to use EXIF
#  EXIF_DEFINITIONS - Compiler switches required for using EXIF
#
#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#


if (EXIF_LIBRARIES AND EXIF_INCLUDE_DIRS)
  # in cache already
  set(EXIF_FOUND TRUE)
else (EXIF_LIBRARIES AND EXIF_INCLUDE_DIRS)
  find_path(EXIF_INCLUDE_DIRS
    NAMES
      exif-data.h
    PATHS
        /usr/include
        /usr/local/include
        /opt/local/include
        /sw/include
        /usr/include/libexif
        /usr/local/include/libexif
        /opt/local/include/libexif
        /sw/include/libexif
  )

  # debian uses version suffixes
  # add suffix evey new release
  find_library(EXIF_LIBRARIES
    NAMES
        exif
    PATHS
      /usr/lib
      /usr/local/lib
      /opt/local/lib
      /sw/lib
  )

  if (EXIF_INCLUDE_DIRS AND EXIF_LIBRARIES)
     set(EXIF_FOUND TRUE)
  endif (EXIF_INCLUDE_DIRS AND EXIF_LIBRARIES)

  if (EXIF_FOUND)
    if (NOT EXIF_FIND_QUIETLY)
      message(STATUS "Found EXIF: ${EXIF_LIBRARIES}")
    endif (NOT EXIF_FIND_QUIETLY)
  else (EXIF_FOUND)
    if (EXIF_FIND_REQUIRED)
      message(FATAL_ERROR "Could not find EXIF")
    endif (EXIF_FIND_REQUIRED)
  endif (EXIF_FOUND)

  # show the EXIF_INCLUDE_DIRS and EXIF_LIBRARIES variables only in the advanced view
  mark_as_advanced(EXIF_INCLUDE_DIRS EXIF_LIBRARIES)

endif (EXIF_LIBRARIES AND EXIF_INCLUDE_DIRS)

if (WIN32)
set(EXIF_FOUND TRUE)
set(EXIF_LIBRARIES "")
set(EXIF_INCLUDE_DIRS "")
endif (WIN32)