File: Findlibraw.cmake

package info (click to toggle)
darktable 5.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,864 kB
  • sloc: ansic: 361,898; cpp: 102,446; xml: 19,813; lisp: 14,539; sh: 3,771; javascript: 3,264; perl: 1,925; python: 1,485; ruby: 975; makefile: 543; asm: 46; sql: 38; awk: 21
file content (51 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (3)
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
#.rst:
# Findlibraw
# -------
#
# Try to find libraw on a Unix system.
#
# This will define the following variables:
#
# ``libraw_FOUND``
#     True if (the requested version of) libraw is available
# ``libraw_VERSION``
#     The version of libraw
# ``libraw_LIBRARIES``
#     This should be passed to target_compile_options() if the target is not
#     used for linking
# ``libraw_INCLUDE_DIRS``
#     This should be passed to target_include_directories() if the target is not
#     used for linking
# ``libraw_DEFINITIONS``
#     This should be passed to target_compile_options() if the target is not
#     used for linking

find_package(PkgConfig QUIET)
pkg_check_modules(PKG_libraw QUIET libraw)

set(libraw_VERSION ${PKG_libraw_VERSION})
set(libraw_DEFINITIONS ${PKG_libraw_CFLAGS_OTHER})

find_path(libraw_INCLUDE_DIR
    NAMES libraw/libraw.h
    HINTS ${PKG_libraw_INCLUDE_DIRS}
)

find_library(libraw_LIBRARY
    NAMES raw
    HINTS ${PKG_libraw_LIBRARY_DIRS}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libraw
    FOUND_VAR libraw_FOUND
    REQUIRED_VARS libraw_LIBRARY
                  libraw_INCLUDE_DIR
    VERSION_VAR libraw_VERSION
)

set(libraw_INCLUDE_DIRS ${libraw_INCLUDE_DIR})
set(libraw_LIBRARIES ${libraw_LIBRARY})

mark_as_advanced(libraw_INCLUDE_DIR)
mark_as_advanced(libraw_LIBRARY)