Warning, /graphics/krita/cmake/modules/FindHEIF.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find the libheif library
0002 # Once done this will define
0003 #
0004 #  HEIF_FOUND - system has heif
0005 #  HEIF_INCLUDE_DIRS - the heif include directories
0006 #  HEIF_LIBRARIES - the libraries needed to use heif
0007 #
0008 # SPDX-License-Identifier: BSD-3-Clause
0009 #
0010 
0011 include(LibFindMacros)
0012 libfind_pkg_check_modules(HEIF_PKGCONF libheif)
0013 
0014 find_path(HEIF_INCLUDE_DIR
0015     NAMES libheif/heif.h
0016     HINTS ${HEIF_PKGCONF_INCLUDE_DIRS} ${HEIF_PKGCONF_INCLUDEDIR}
0017     PATH_SUFFIXES heif
0018 )
0019 
0020 find_library(HEIF_LIBRARY
0021     NAMES libheif heif
0022     HINTS ${HEIF_PKGCONF_LIBRARY_DIRS} ${HEIF_PKGCONF_LIBDIR}
0023     DOC "Libraries to link against for HEIF Support"
0024 )
0025 
0026 set(HEIF_PROCESS_LIBS HEIF_LIBRARY)
0027 set(HEIF_PROCESS_INCLUDES HEIF_INCLUDE_DIR)
0028 libfind_process(HEIF)
0029 
0030 if(HEIF_INCLUDE_DIR)
0031   set(heif_config_file "${HEIF_INCLUDE_DIR}/libheif/heif_version.h")
0032   if(EXISTS ${heif_config_file})
0033       file(STRINGS
0034            ${heif_config_file}
0035            TMP
0036            REGEX "#define LIBHEIF_VERSION.*$")
0037       string(REGEX MATCHALL "[0-9.]+" LIBHEIF_VERSION ${TMP})
0038   endif()
0039 endif()
0040 
0041 include(FindPackageHandleStandardArgs)
0042 find_package_handle_standard_args(HEIF
0043     REQUIRED_VARS
0044         HEIF_INCLUDE_DIR
0045         HEIF_LIBRARY
0046     VERSION_VAR
0047         LIBHEIF_VERSION
0048 )