File: FindGraphicsMagick.cmake

package info (click to toggle)
darktable 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 26,388 kB
  • sloc: ansic: 226,545; cpp: 33,844; xml: 11,633; lisp: 8,205; sh: 2,988; perl: 1,703; ruby: 1,196; python: 586; makefile: 294; awk: 110; asm: 46; sql: 38
file content (38 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (8)
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
#
# Find the GraphicsMagick includes and library
#

# This module defines
# GraphicsMagick_INCLUDE_DIR, where to find *.h etc
# GraphicsMagick_LIBRARY, the libraries
# GraphicsMagick_FOUND, If false, do not try to use LCMS.


include(LibFindMacros)

# Use pkg-config to get hints about paths
libfind_pkg_check_modules(GraphicsMagick_PKGCONF GraphicsMagick)

# Include dir
find_path(GraphicsMagick_INCLUDE_DIR
  NAMES magick/api.h
  HINTS ${GraphicsMagick_PKGCONF_INCLUDE_DIRS}
  PATH_SUFFIXES GraphicsMagick
)

# Finally the library itself
find_library(GraphicsMagick_LIBRARY
  NAMES GraphicsMagick
  HINTS ${GraphicsMagick_PKGCONF_LIBRARY_DIRS}
)

# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(GraphicsMagick_PROCESS_INCLUDES ${GraphicsMagick_INCLUDE_DIR})
set(GraphicsMagick_PROCESS_LIBS ${GraphicsMagick_LIBRARY})
libfind_process(GraphicsMagick)

if(GraphicsMagick_FOUND)
  set(GraphicsMagick_INCLUDE_DIRS ${GraphicsMagick_INCLUDE_DIR})
  set(GraphicsMagick_LIBRARIES ${GraphicsMagick_LIBRARY})
endif(GraphicsMagick_FOUND)