Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FindHaru.cmake « Modules « cmake « build_files - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e00d6133d80db4d91d969a5e0a700b07c69b8441 (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
51
52
53
54
55
56
57
58
59
60
61
62
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2021 Blender Foundation.

# - Find HARU library
# Find the native Haru includes and library
# This module defines
#  HARU_INCLUDE_DIRS, where to find hpdf.h, set when
#                        HARU_INCLUDE_DIR is found.
#  HARU_LIBRARIES, libraries to link against to use Haru.
#  HARU_ROOT_DIR, The base directory to search for Haru.
#                    This can also be an environment variable.
#  HARU_FOUND, If false, do not try to use Haru.
#
# also defined, but not for general use are
#  HARU_LIBRARY, where to find the Haru library.

# If HARU_ROOT_DIR was defined in the environment, use it.
if(NOT HARU_ROOT_DIR AND NOT $ENV{HARU_ROOT_DIR} STREQUAL "")
  set(HARU_ROOT_DIR $ENV{HARU_ROOT_DIR})
endif()

set(_haru_SEARCH_DIRS
  ${HARU_ROOT_DIR}
  /opt/lib/haru
)

find_path(HARU_INCLUDE_DIR
  NAMES
    hpdf.h
  HINTS
    ${_haru_SEARCH_DIRS}
  PATH_SUFFIXES
    include/haru
    include
)

find_library(HARU_LIBRARY
  NAMES
    hpdfs
    hpdf
  HINTS
    ${_haru_SEARCH_DIRS}
  PATH_SUFFIXES
    lib64 lib
)

# Handle the QUIETLY and REQUIRED arguments and set HARU_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Haru DEFAULT_MSG HARU_LIBRARY HARU_INCLUDE_DIR)

if(HARU_FOUND)
  set(HARU_LIBRARIES ${HARU_LIBRARY})
  set(HARU_INCLUDE_DIRS ${HARU_INCLUDE_DIR})
endif()

mark_as_advanced(
  HARU_INCLUDE_DIR
  HARU_LIBRARY
)

unset(_haru_SEARCH_DIRS)