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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Meel <ankitjmeel@gmail.com>2021-02-01 19:28:57 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2021-02-01 19:28:57 +0300
commit59054d906fa9b539a14768101ba66c1182c13f0f (patch)
treebc10d904496f23fadd7a3a06537ad0cbbd7ea4fe /build_files/cmake/Modules
parent84dddf641edecb9de773ac7e07d18dab49b82db5 (diff)
CMake/Windows/macOS: Add Libharu
Decision: https://lists.blender.org/pipermail/bf-committers/2020-December/050836.html Adds CMake dependency builder support. Tested on macOS and Windows (Thanks @LazyDodo). Reviewed By: #platform_macos, LazyDodo, sebbas Maniphest Task: T84836 Differential Revision: https://developer.blender.org/D9928
Diffstat (limited to 'build_files/cmake/Modules')
-rw-r--r--build_files/cmake/Modules/FindHaru.cmake64
1 files changed, 64 insertions, 0 deletions
diff --git a/build_files/cmake/Modules/FindHaru.cmake b/build_files/cmake/Modules/FindHaru.cmake
new file mode 100644
index 00000000000..5774f83b8c5
--- /dev/null
+++ b/build_files/cmake/Modules/FindHaru.cmake
@@ -0,0 +1,64 @@
+# - 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.
+
+#=============================================================================
+# Copyright 2021 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD 3-Clause License,
+# see accompanying file BSD-3-Clause-license.txt for details.
+#=============================================================================
+
+# 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
+)
+
+find_library(HARU_LIBRARY
+ NAMES
+ hpdfs
+ 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)