Commit b24654a3 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix searching for openjpeg

parent ef6f358d
......@@ -645,8 +645,12 @@ set_package_properties(HEIF PROPERTIES
TYPE OPTIONAL
PURPOSE "Required by the Krita HEIF filter")
macro_optional_find_package(OpenJPEG)
macro_log_feature(OPENJPEG_FOUND "openjpeg" "Free library for JPEG 2000 image compression" "http://www.openjpeg.org" FALSE "" "Required by the Krita JPEG 2000 filter")
find_package(OpenJPEG "2.3.0")
set_package_properties(OpenJPEG PROPERTIES
DESCRIPTION "Library for loading and saving jp2000 files."
URL "http://www.openjpeg.org/"
TYPE OPTIONAL
PURPOSE "Required by the Krita JP2000 filter")
set(LIBRAW_MIN_VERSION "0.16")
find_package(LibRaw ${LIBRAW_MIN_VERSION})
......
# -*- cmake -*-
# - Find OpenJPEG
# Find the OpenJPEG includes and library
# This module defines
# OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc.
# OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG.
# OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
# also defined, but not for general use are
# OPENJPEG_LIBRARY, where to find the OpenJPEG library.
find_path(OPENJPEG_INCLUDE_DIR openjpeg.h
PATHS
/usr/local/include/openjpeg
/usr/local/include
/usr/include/openjpeg
/usr/include/openjpeg-1.5
/usr/include
PATH_SUFFIXES
openjpeg-1.5
openjpeg
# - Try to find OpenJPEG
# Once done, this will define
#
# OpenJPEG_FOUND - system has OpenJPEG
# OpenJPEG_INCLUDE_DIRS - the OpenJPEG include directories
# OpenJPEG_LIBRARIES - link these to use OpenJPEG
include(LibFindMacros)
# Use pkg-config to get hints about paths
libfind_pkg_check_modules(OpenJPEG_PKGCONF libopenjp2)
# Include dir
find_path(OpenJPEG_INCLUDE_DIR
NAMES openjpeg.h
HINTS ${OpenJPEG_PKGCONF_INCLUDE_DIRS}
)
set(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg)
find_library(OPENJPEG_LIBRARY
NAMES ${OPENJPEG_NAMES}
PATHS
/usr/lib /usr/local/lib
# Finally the library itself
find_library(OpenJPEG_LIBRARY
NAMES openjp2
HINTS ${OpenJPEG_PKGCONF_LIBRARY_DIRS}
)
if (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
set(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
set(OPENJPEG_FOUND "YES")
else ()
set(OPENJPEG_FOUND "NO")
endif ()
if (OPENJPEG_FOUND)
if (NOT OPENJPEG_FIND_QUIETLY)
message(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")
endif ()
else ()
if (OPENJPEG_FIND_REQUIRED)
message(FATAL_ERROR "Could not find OpenJPEG library")
endif ()
endif ()
# Deprecated declarations.
set (NATIVE_OPENJPEG_INCLUDE_PATH ${OPENJPEG_INCLUDE_DIR} )
get_filename_component (NATIVE_OPENJPEG_LIB_PATH ${OPENJPEG_LIBRARY} PATH)
mark_as_advanced(
OPENJPEG_LIBRARY
OPENJPEG_INCLUDE_DIR
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this lib depends on.
set(OpenJPEG_PROCESS_INCLUDES OpenJPEG_INCLUDE_DIR)
set(OpenJPEG_PROCESS_LIBS OpenJPEG_LIBRARY)
libfind_process(OpenJPEG)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment