[poppler] CMakeLists.txt cmake/modules

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Aug 16 09:20:53 UTC 2018


 CMakeLists.txt                       |   16 ++++++++--------
 cmake/modules/FindLIBOPENJPEG2.cmake |   22 ----------------------
 2 files changed, 8 insertions(+), 30 deletions(-)

New commits:
commit 12bf632489587df9da416ed8303fb8aefc26bdac
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Aug 16 11:18:21 2018 +0200

    Use OpenJpeg cmake config file instead of pkgconfig

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cdfe7795..da9d5364 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/cmake/modules/FindLIBOPENJPEG2.cmake b/cmake/modules/FindLIBOPENJPEG2.cmake
deleted file mode 100644
index 654620eb..00000000
--- a/cmake/modules/FindLIBOPENJPEG2.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-# - 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 at 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 ()


More information about the poppler mailing list