Commit 12bf6324 authored by Albert Astals Cid's avatar Albert Astals Cid

Use OpenJpeg cmake config file instead of pkgconfig

parent 0f35c2de
......@@ -201,9 +201,9 @@ if(ENABLE_ZLIB_UNCOMPRESS AND NOT ENABLE_ZLIB)
endif()
set(WITH_OPENJPEG FALSE)
if(ENABLE_LIBOPENJPEG STREQUAL "openjpeg2")
find_package(LIBOPENJPEG2)
set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
if(NOT LIBOPENJPEG2_FOUND)
find_package(OpenJPEG)
set(WITH_OPENJPEG ${OpenJPEG_FOUND})
if(NOT OpenJPEG_FOUND)
message(FATAL_ERROR "Install libopenjpeg2 before trying to build poppler. You can also decide to use the internal unmaintained JPX decoder or none at all.")
endif()
set(HAVE_JPX_DECODER ON)
......@@ -276,8 +276,8 @@ if(TIFF_FOUND)
include_directories(${TIFF_INCLUDE_DIR})
set(ENABLE_LIBTIFF ON)
endif()
if(LIBOPENJPEG2_FOUND)
include_directories(${LIBOPENJPEG2_INCLUDE_DIRS})
if(OpenJPEG_FOUND)
include_directories(${OPENJPEG_INCLUDE_DIRS})
endif()
if(LCMS2_FOUND)
include_directories(${LCMS2_INCLUDE_DIR})
......@@ -457,11 +457,11 @@ if (ENABLE_NSS3)
)
set(poppler_LIBS ${poppler_LIBS} ${NSS3_LIBRARIES})
endif()
if (LIBOPENJPEG2_FOUND)
if (OpenJPEG_FOUND)
set(poppler_SRCS ${poppler_SRCS}
poppler/JPEG2000Stream.cc
)
set(poppler_LIBS ${poppler_LIBS} ${LIBOPENJPEG2_LIBRARIES})
set(poppler_LIBS ${poppler_LIBS} openjp2)
else ()
set(poppler_SRCS ${poppler_SRCS}
poppler/JPXStream.cc
......@@ -621,7 +621,7 @@ if(ENABLE_XPDF_HEADERS)
poppler/CurlPDFDocBuilder.h
DESTINATION include/poppler)
endif()
if(LIBOPENJPEG2_FOUND)
if(OpenJPEG_FOUND)
install(FILES
poppler/JPEG2000Stream.h
DESTINATION include/poppler)
......
# - Try to find the libopenjpeg2 library
# Once done this will define
#
# LIBOPENJPEG2_FOUND - system has libopenjpeg
# LIBOPENJPEG2_INCLUDE_DIRS - the libopenjpeg include directories
# LIBOPENJPEG2_LIBRARIES - Link these to use libopenjpeg
# Copyright (c) 2008, Albert Astals Cid, <aacid@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
set(LIBOPENJPEG2_FOUND FALSE)
set(LIBOPENJPEG2_INCLUDE_DIRS)
set(LIBOPENJPEG2_LIBRARIES)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBOPENJPEG2 libopenjp2)
if (LIBOPENJPEG2_FOUND)
add_definitions(-DUSE_OPENJPEG2)
endif ()
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