"Fossies" - the Fresh Open Source Software Archive

Member "libgd-2.3.2/cmake/modules/FindHEIF.cmake" (3 Mar 2021, 3041 Bytes) of package /linux/www/libgd-2.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) CMake source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # - Find the native HEIF includes and library
    2 #
    3 
    4 # This module defines
    5 #  HEIF_INCLUDE_DIR, where to find heif.h, etc.
    6 #  HEIF_LIBRARIES, the libraries to link against to use HEIF.
    7 #  HEIF_FOUND, If false, do not try to use HEIF.
    8 # Also defined, but not for general use are
    9 #  HEIF_LIBRARY, where to find the HEIF library.
   10 
   11 # Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
   12 #
   13 # Redistribution and use in source and binary forms, with or without
   14 # modification, are permitted provided that the following conditions are
   15 # met:
   16 #
   17 #  * Redistributions of source code must retain the above copyright notice,
   18 #    this list of conditions and the following disclaimer.
   19 #
   20 #  * Redistributions in binary form must reproduce the above copyright notice,
   21 #    this list of conditions and the following disclaimer in the documentation
   22 #    and/or other materials provided with the distribution.
   23 #
   24 #  * The names of Kitware, Inc., the Insight Consortium, or the names of
   25 #    any consortium members, or of any contributors, may not be used to
   26 #    endorse or promote products derived from this software without
   27 #    specific prior written permission.
   28 #
   29 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
   30 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   31 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   32 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
   33 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   34 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   35 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   36 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   37 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   38 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   39 
   40 SET(HEIF_FOUND "NO")
   41 
   42 # use pkg-config to get the directories and then use these values
   43 # in the FIND_PATH() and FIND_LIBRARY() calls
   44 if( NOT WIN32 )
   45   find_package(PkgConfig)
   46 
   47   pkg_check_modules(HEIF_PKG QUIET fontconfig)
   48 endif( NOT WIN32 )
   49 
   50 FIND_PATH(HEIF_INCLUDE_DIR NAMES libheif/heif.h
   51   PATHS
   52     /usr/local/include
   53     /usr/include
   54   HINTS
   55     ${HEIF_PKG_INCLUDE_DIRS} # Generated by pkg-config
   56 )
   57 
   58 SET(HEIF_NAMES ${HEIF_NAMES} heif ${HEIF_PKG_LIBRARY})
   59 FIND_LIBRARY(HEIF_LIBRARY
   60   NAMES ${HEIF_NAMES}
   61   PATH /usr/local/lib /usr/lib
   62   PATH_SUFFIXES lib64 lib
   63   HINTS ${HEIF_PKG_LIBRARY_DIRS} # Generated by pkg-config
   64 )
   65 
   66 IF (HEIF_LIBRARY AND HEIF_INCLUDE_DIR)
   67     SET(HEIF_FOUND "YES")
   68     SET(HAVE_LIBHEIF 1)
   69     SET(HEIF_LIBRARIES ${HEIF_LIBRARY})
   70 ENDIF (HEIF_LIBRARY AND HEIF_INCLUDE_DIR)
   71 
   72 IF (HEIF_FOUND)
   73     IF (NOT HEIF_FIND_QUIETLY)
   74         MESSAGE(STATUS "Find HEIF: ${HEIF_LIBRARY}")
   75     ENDIF (NOT HEIF_FIND_QUIETLY)
   76 ELSE (HEIF_FOUND)
   77     IF (HEIF_FIND_REQUIRED)
   78         MESSAGE(FATAL_ERROR "Could not find HEIF library")
   79     ENDIF (HEIF_FIND_REQUIRED)
   80 ENDIF (HEIF_FOUND)
   81 
   82 MARK_AS_ADVANCED(HEIF_INCLUDE_DIR HEIF_LIBRARY)