File: FindJsonGlib.cmake

package info (click to toggle)
darktable 2.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,236 kB
  • sloc: ansic: 200,593; cpp: 23,773; xml: 10,142; lisp: 7,084; sh: 2,489; perl: 1,701; ruby: 1,155; python: 426; makefile: 289; awk: 110; asm: 46
file content (37 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (5)
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
# - Try to find JsonGlib-1.0
# Once done, this will define
#
#  JsonGlib_FOUND - system has Glib
#  JsonGlib_INCLUDE_DIRS - the Glib include directories
#  JsonGlib_LIBRARIES - link these to use Glib

include(LibFindMacros)

# Use pkg-config to get hints about paths
libfind_pkg_check_modules(JsonGlib_PKGCONF json-glib-1.0)

# Main include dir
find_path(JsonGlib_INCLUDE_DIR
  NAMES json-glib/json-glib.h
  HINTS ${JsonGlib_PKGCONF_INCLUDE_DIRS}
  PATH_SUFFIXES json-glib-1.0
)

# Finally the library itself
find_library(JsonGlib_LIBRARY
  NAMES json-glib-1.0
  HINTS ${JsonGlib_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 this lib depends on.
set(JsonGlib_PROCESS_INCLUDES ${JsonGlib_INCLUDE_DIR})
set(JsonGlib_PROCESS_LIBS ${JsonGlib_LIBRARY})
libfind_process(JsonGlib)

if(JsonGlib_FOUND)
  set(JsonGlib_INCLUDE_DIRS ${JsonGlib_INCLUDE_DIR})
  set(JsonGlib_LIBRARIES ${JsonGlib_LIBRARY})
endif(JsonGlib_FOUND)