[poppler] CMakeLists.txt cmake/modules cpp/CMakeLists.txt .gitlab-ci.yml poppler/GfxFont.cc qt5/CMakeLists.txt

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 1 21:43:08 UTC 2022


 .gitlab-ci.yml                     |    4 +-
 CMakeLists.txt                     |   58 +++++++++++++++++++--------------
 cmake/modules/FindFontconfig.cmake |   52 ------------------------------
 cmake/modules/FindIconv.cmake      |   64 -------------------------------------
 cpp/CMakeLists.txt                 |    3 -
 poppler/GfxFont.cc                 |   14 ++++----
 qt5/CMakeLists.txt                 |    2 -
 7 files changed, 44 insertions(+), 153 deletions(-)

New commits:
commit d5ea5a24124badf2b32a7d08dd2c06a4a40f93fb
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Mar 8 14:32:54 2022 +0100

    Increase Minimum supported base to that provided by Ubuntu 20.04

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b5db08a9..8fe388f7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -65,9 +65,9 @@ build_clang14_libcpp:
     - cp "$srcdir/.clang-tidy" .
     - run-clang-tidy-14
 
-build_ubuntu_18_04:
+build_ubuntu_20_04:
   stage: build
-  image: ubuntu:bionic
+  image: ubuntu:20.04
   before_script:
     - apt-get update
     - apt-get install --yes --no-install-recommends build-essential cmake ninja-build libjpeg-dev libopenjp2-7-dev qtbase5-dev gobject-introspection libglib2.0-dev libgtk-3-dev libgirepository1.0-dev libnss3-dev ca-certificates libcurl4-nss-dev liblcms2-dev libboost-container-dev libtiff-dev
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c53a6265..9861a436 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
 
 project(poppler)
 
@@ -26,6 +26,7 @@ CHECK_FILE_OFFSET_BITS()
 
 include(GenerateExportHeader)
 include(GNUInstallDirs)
+include(CMakePushCheckState)
 
 set(ENABLE_FUZZER FALSE)
 
@@ -136,15 +137,16 @@ set(OPI_SUPPORT ON)
 set(TEXTOUT_WORD_LIST ON)
 
 # setting the minimum required versions for some components
-set(CAIRO_VERSION "1.10.0")
-set(GLIB_REQUIRED "2.56")
-set(GTK_REQUIRED "3.22")
-set(GDK_PIXBUF_REQUIRED "2.36")
-set(FREETYPE_VERSION "2.8")
+set(CAIRO_VERSION "1.16.0")
+set(GLIB_REQUIRED "2.64")
+set(GTK_REQUIRED "3.24")
+set(GDK_PIXBUF_REQUIRED "2.40")
+set(FREETYPE_VERSION "2.10")
+set(FONTCONFIG_VERSION "2.13")
 
 find_package(Freetype ${FREETYPE_VERSION} REQUIRED)
 if(WITH_FONTCONFIGURATION_FONTCONFIG)
-  find_package(Fontconfig REQUIRED)
+  find_package(Fontconfig ${FONTCONFIG_VERSION} REQUIRED)
 endif()
 macro_optional_find_package(JPEG)
 macro_optional_find_package(PNG)
@@ -172,7 +174,7 @@ else()
 endif()
 
 if (ENABLE_QT5)
-  find_package(Qt5Core 5.9)  # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this
+  find_package(Qt5Core 5.12)  # Update QT_DISABLE_DEPRECATED_BEFORE in qt5/CMakeLists.txt when increasing this
   find_package(Qt5Gui)
   find_package(Qt5Xml)
   find_package(Qt5Widgets)
@@ -195,7 +197,7 @@ endif()
 # Check for Cairo rendering backend
 macro_optional_find_package(Cairo ${CAIRO_VERSION})
 
-find_package(Boost 1.58.0)
+find_package(Boost 1.71.0)
 if(Boost_FOUND)
   set(USE_BOOST_HEADERS ON)
 elseif(ENABLE_BOOST)
@@ -217,7 +219,7 @@ if(CAIRO_FOUND)
   if(ENABLE_GLIB)
     if(ENABLE_GOBJECT_INTROSPECTION)
       # Check for introspection
-      macro_optional_find_package(GObjectIntrospection 0.9.12)
+      macro_optional_find_package(GObjectIntrospection 1.64.0)
       set(HAVE_INTROSPECTION ${INTROSPECTION_FOUND})
     endif()
     set(POPPLER_GLIB_DISABLE_DEPRECATED "${POPPLER_GLIB_DISABLE_DEPRECATED} -DG_DISABLE_DEPRECATED")
@@ -245,7 +247,25 @@ if(ENABLE_GTK_DOC)
 endif()
 
 if(ENABLE_CPP)
+  cmake_push_check_state()
   find_package(Iconv REQUIRED)
+  set(CMAKE_REQUIRED_LIBRARIES Iconv::Iconv)
+  check_cxx_source_compiles("
+    #include <iconv.h>
+    int main(){
+      iconv_t conv = 0;
+      const char* in = 0;
+      size_t ilen = 0;
+      char* out = 0;
+      size_t olen = 0;
+      iconv(conv, &in, &ilen, &out, &olen);
+      return 0;
+    }
+  " ICONV_SECOND_ARGUMENT_IS_CONST)
+  cmake_pop_check_state()
+  if(ICONV_SECOND_ARGUMENT_IS_CONST)
+    set(ICONV_CONST "const")
+  endif()
 endif()
 if(ENABLE_ZLIB)
   find_package(ZLIB)
@@ -460,21 +480,14 @@ set(poppler_SRCS
 )
 set(poppler_LIBS Freetype::Freetype)
 if(FONTCONFIG_FOUND)
-  add_definitions(${FONTCONFIG_DEFINITIONS})
-  include_directories(SYSTEM ${FONTCONFIG_INCLUDE_DIR})
-  set(poppler_LIBS ${poppler_LIBS} ${FONTCONFIG_LIBRARIES})
+  set(poppler_LIBS ${poppler_LIBS} Fontconfig::Fontconfig)
 endif()
 
 if(JPEG_FOUND)
   set(poppler_SRCS ${poppler_SRCS}
     poppler/DCTStream.cc
   )
-  if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
-    include_directories(SYSTEM ${JPEG_INCLUDE_DIR})
-    set(poppler_LIBS ${poppler_LIBS} ${JPEG_LIBRARIES})
-  else()
-    set(poppler_LIBS ${poppler_LIBS} JPEG::JPEG)
-  endif()
+  set(poppler_LIBS ${poppler_LIBS} JPEG::JPEG)
 endif()
 if(ENABLE_ZLIB)
   set(poppler_SRCS ${poppler_SRCS}
@@ -492,12 +505,7 @@ if(ENABLE_LIBCURL)
     poppler/CurlCachedFile.cc
     poppler/CurlPDFDocBuilder.cc
   )
-  if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
-    include_directories(SYSTEM ${CURL_INCLUDE_DIRS})
-    set(poppler_LIBS ${poppler_LIBS} ${CURL_LIBRARIES})
-  else()
-    set(poppler_LIBS ${poppler_LIBS} CURL::libcurl)
-  endif()
+  set(poppler_LIBS ${poppler_LIBS} CURL::libcurl)
 endif()
 if (ENABLE_NSS3)
   set(poppler_SRCS ${poppler_SRCS}
diff --git a/cmake/modules/FindFontconfig.cmake b/cmake/modules/FindFontconfig.cmake
deleted file mode 100644
index 375bf7a0..00000000
--- a/cmake/modules/FindFontconfig.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# - Try to find the  Fontconfig
-# Once done this will define
-#
-#  FONTCONFIG_FOUND - system has Fontconfig
-#  FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers
-#  FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
-#  FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
-
-# Copyright (c) 2006,2007 Laurent Montel, <montel 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.
-
-# NOTE: Once required cmake >=3.14, consider using built-in FindFontconfig
-#       See Poppler issue #955 for details
-
-if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
-
-  # in cache already
-  set(FONTCONFIG_FOUND TRUE)
-
-else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
-
-  if (NOT WIN32)
-    # use pkg-config to get the directories and then use these values
-    # in the FIND_PATH() and FIND_LIBRARY() calls
-    find_package(PkgConfig)
-    pkg_check_modules(PC_FONTCONFIG fontconfig)
-
-    set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
-  endif (NOT WIN32)
-
-  find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
-    PATHS
-    ${PC_FONTCONFIG_INCLUDEDIR}
-    ${PC_FONTCONFIG_INCLUDE_DIRS}
-    /usr/X11/include
-  )
-
-  find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
-    PATHS
-    ${PC_FONTCONFIG_LIBDIR}
-    ${PC_FONTCONFIG_LIBRARY_DIRS}
-  )
-
-  include(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
-  
-  mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
-
-endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
-
diff --git a/cmake/modules/FindIconv.cmake b/cmake/modules/FindIconv.cmake
deleted file mode 100644
index ab9ad563..00000000
--- a/cmake/modules/FindIconv.cmake
+++ /dev/null
@@ -1,64 +0,0 @@
-# - Try to find Iconv 
-# Once done this will define 
-# 
-#  ICONV_FOUND - system has Iconv 
-#  ICONV_INCLUDE_DIR - the Iconv include directory 
-#  ICONV_LIBRARIES - Link these to use Iconv 
-#  ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
-# 
-
-# NOTE: Once required CMake >=3.11, consider using built-in FindIconv
-#       See Poppler issue #955 for details
-
-include(CheckCXXSourceCompiles)
-
-IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
-  # Already in cache, be silent
-  SET(ICONV_FIND_QUIETLY TRUE)
-ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
-
-FIND_PATH(ICONV_INCLUDE_DIR iconv.h) 
- 
-FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
- 
-IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
-   SET(ICONV_FOUND TRUE) 
-ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 
-
-set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
-set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
-IF(ICONV_FOUND)
-  check_cxx_source_compiles("
-  #include <iconv.h>
-  int main(){
-    iconv_t conv = 0;
-    const char* in = 0;
-    size_t ilen = 0;
-    char* out = 0;
-    size_t olen = 0;
-    iconv(conv, &in, &ilen, &out, &olen);
-    return 0;
-  }
-" ICONV_SECOND_ARGUMENT_IS_CONST )
-  IF(ICONV_SECOND_ARGUMENT_IS_CONST)
-    SET(ICONV_CONST "const")
-  ENDIF(ICONV_SECOND_ARGUMENT_IS_CONST)
-ENDIF(ICONV_FOUND)
-set(CMAKE_REQUIRED_INCLUDES)
-set(CMAKE_REQUIRED_LIBRARIES)
-
-IF(ICONV_FOUND) 
-  IF(NOT ICONV_FIND_QUIETLY) 
-    MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}") 
-  ENDIF(NOT ICONV_FIND_QUIETLY) 
-ELSE(ICONV_FOUND) 
-  IF(Iconv_FIND_REQUIRED) 
-    MESSAGE(FATAL_ERROR "Could not find Iconv") 
-  ENDIF(Iconv_FIND_REQUIRED) 
-ENDIF(ICONV_FOUND) 
-
-MARK_AS_ADVANCED(
-  ICONV_INCLUDE_DIR
-  ICONV_LIBRARIES
-  ICONV_SECOND_ARGUMENT_IS_CONST
-)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index a878faf7..48851454 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -1,7 +1,6 @@
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
-  ${ICONV_INCLUDE_DIR}
 )
 
 configure_file(poppler-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h @ONLY)
@@ -31,7 +30,7 @@ if(MINGW AND BUILD_SHARED_LIBS)
     get_target_property(POPPLER_CPP_SOVERSION poppler-cpp SOVERSION)
     set_target_properties(poppler-cpp PROPERTIES SUFFIX "-${POPPLER_CPP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
 endif()
-target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES})
+target_link_libraries(poppler-cpp poppler Iconv::Iconv)
 install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 install(FILES
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index b0d0d610..cc2ce038 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -657,7 +657,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
                 fontLoc.locType = gfxFontLocEmbedded;
                 fontLoc.fontType = type;
                 fontLoc.embFontID = embFontID;
-                return std::move(fontLoc); // std::move only required to please g++-7
+                return fontLoc;
             }
         }
     }
@@ -668,7 +668,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
         fontLoc.locType = gfxFontLocResident;
         fontLoc.fontType = fontType1;
         fontLoc.path = *name;
-        return std::move(fontLoc); // std::move only required to please g++-7
+        return fontLoc;
     }
 
     //----- PS resident Base-14 font
@@ -677,7 +677,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
         fontLoc.locType = gfxFontLocResident;
         fontLoc.fontType = fontType1;
         fontLoc.path = ((Gfx8BitFont *)this)->base14->base14Name;
-        return std::move(fontLoc); // std::move only required to please g++-7
+        return fontLoc;
     }
 
     //----- external font file (fontFile, fontDir)
@@ -708,7 +708,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
                 fontLoc.fontType = fontCIDType2;
                 fontLoc.setPath(path);
                 fontLoc.fontNum = fontNum;
-                return std::move(fontLoc); // std::move only required to please g++-7
+                return fontLoc;
             }
         } else {
             GfxFontLoc fontLoc;
@@ -720,7 +720,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
                 fontLoc.fontType = fontType1;
                 fontLoc.fontNum = fontNum;
             }
-            return std::move(fontLoc); // std::move only required to please g++-7
+            return fontLoc;
         }
         delete path;
     }
@@ -749,7 +749,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
             fontLoc.fontType = fontType1;
             fontLoc.path = substName;
             fontLoc.substIdx = substIdx;
-            return std::move(fontLoc); // std::move only required to please g++-7
+            return fontLoc;
         } else {
             path = globalParams->findFontFile(substName);
             if (path) {
@@ -811,7 +811,7 @@ std::optional<GfxFontLoc> GfxFont::getExternalFont(GooString *path, bool cid)
     fontLoc.locType = gfxFontLocExternal;
     fontLoc.fontType = fontType;
     fontLoc.setPath(path);
-    return std::move(fontLoc); // std::move only required to please g++-7
+    return fontLoc;
 }
 
 std::optional<std::vector<unsigned char>> GfxFont::readEmbFontFile(XRef *xref)
diff --git a/qt5/CMakeLists.txt b/qt5/CMakeLists.txt
index 64e81601..80b05852 100644
--- a/qt5/CMakeLists.txt
+++ b/qt5/CMakeLists.txt
@@ -5,7 +5,7 @@ if(ENABLE_QT_STRICT_ITERATORS)
   add_definitions(-DQT_STRICT_ITERATORS)
 endif()
 
-add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050900)
+add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050C00)
 add_definitions(-DQT_NO_DEPRECATED_WARNINGS)
 
 add_subdirectory(src)


More information about the poppler mailing list