[poppler] CMakeLists.txt configure.ac

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Dec 3 01:20:15 UTC 2016


 CMakeLists.txt |   16 ++++++++--------
 configure.ac   |   31 ++++++++++++++++---------------
 2 files changed, 24 insertions(+), 23 deletions(-)

New commits:
commit 21cd08e34bd317b2ecc7c8b4e0d122d85bdf6714
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Dec 3 02:18:58 2016 +0100

    Default to libopenjpeg2 instead of libopenjpeg1
    
    Tested 2.1.1 and it's better or equal than the old libopenjpeg1
    
    I thought of doing a version check but i don't think it's common someone will be building a new poppler with an old libopenjpeg2

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c25e961..6e0340b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -168,13 +168,13 @@ set(USE_OPENJPEG1 FALSE)
 set(USE_OPENJPEG2 FALSE)
 set(WITH_OPENJPEG FALSE)
 if(ENABLE_LIBOPENJPEG STREQUAL "auto")
-  find_package(LIBOPENJPEG)
-  set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
-  set(WITH_OPENJPEG ${LIBOPENJPEG_FOUND})
-  if(NOT LIBOPENJPEG_FOUND)
-    find_package(LIBOPENJPEG2)
-    set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
-    set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
+  find_package(LIBOPENJPEG2)
+  set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
+  set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
+  if(NOT LIBOPENJPEG2_FOUND)
+    find_package(LIBOPENJPEG)
+    set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
+    set(WITH_OPENJPEG ${LIBOPENJPEG_FOUND})  
   endif()
 elseif(ENABLE_LIBOPENJPEG STREQUAL "openjpeg1")
   find_package(LIBOPENJPEG)
@@ -779,5 +779,5 @@ if(ENABLE_ZLIB_UNCOMPRESS)
 endif(ENABLE_ZLIB_UNCOMPRESS)
 
 if(NOT WITH_OPENJPEG)
-  message("Warning: Using libopenjpeg is recommended. The internal JPX decoder is unmaintained.")
+  message("Warning: Using libopenjpeg2 is recommended. The internal JPX decoder is unmaintained.")
 endif(NOT WITH_OPENJPEG)
diff --git a/configure.ac b/configure.ac
index 0ba420a..e7ef44f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,25 +207,26 @@ AC_ARG_ENABLE(libopenjpeg,
 
 openjpeg_header=yes
 
-dnl test for libopenjpeg1
-if test x$enable_libopenjpeg = xopenjpeg1 || test x$enable_libopenjpeg = xauto; then
-  PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
-    [openjpeg1="yes"],
-    [AC_CHECK_LIB([openjpeg], [opj_cio_open],
-      [openjpeg1="yes"
-       LIBOPENJPEG_LIBS="-lopenjpeg"],[openjpeg_header=no])
-     AC_CHECK_HEADERS([openjpeg.h],,
-		      [openjpeg_header="no"])])
+dnl test for libopenjpeg2
+if test x$enable_libopenjpeg = xopenjpeg2 || test x$enable_libopenjpeg = xauto; then
+  PKG_CHECK_MODULES(LIBOPENJPEG, libopenjp2,
+                    [openjpeg2=yes],[openjpeg2=no])
 fi
 
-dnl test for libopenjpeg2
-if test x$openjpeg1 = xno; then
-  if test x$enable_libopenjpeg = xopenjpeg2 || test x$enable_libopenjpeg = xauto; then
-    PKG_CHECK_MODULES(LIBOPENJPEG, libopenjp2,
-                      [openjpeg2=yes],[openjpeg2=no])
+dnl test for libopenjpeg1
+if test x$openjpeg2 = xno; then
+  if test x$enable_libopenjpeg = xopenjpeg1 || test x$enable_libopenjpeg = xauto; then
+    PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
+      [openjpeg1="yes"],
+      [AC_CHECK_LIB([openjpeg], [opj_cio_open],
+        [openjpeg1="yes"
+         LIBOPENJPEG_LIBS="-lopenjpeg"],[openjpeg_header=no])
+       AC_CHECK_HEADERS([openjpeg.h],,
+		        [openjpeg_header="no"])])
   fi
 fi
 
+
 if test x$enable_libopenjpeg = xopenjpeg1 && test x$openjpeg1 = xno; then
   if test x$openjpeg_header = xno; then
     AC_MSG_ERROR("*** libopenjpeg headers not found ***")
@@ -1085,5 +1086,5 @@ if test x$enable_zlib_uncompress != xno; then
 fi
 
 if test x$enable_libopenjpeg != xyes; then
-	echo "  Warning: Using libopenjpeg is recommended. The internal JPX decoder is unmaintained."
+	echo "  Warning: Using libopenjpeg2 is recommended. The internal JPX decoder is unmaintained."
 fi


More information about the poppler mailing list