CMakeLists.txt | 17 ++++++++++++++++ cmake/modules/FindFontconfig.cmake | 2 + cmake/modules/FindGLIB.cmake | 2 - cmake/modules/FindGTK.cmake | 2 + cmake/modules/FindIconv.cmake | 4 +++ glib/CMakeLists.txt | 38 ++++++++++++++++++++++--------------- 6 files changed, 49 insertions(+), 16 deletions(-)
New commits: commit 061bae27a04684bdb0a1b4a6c3a8adf7fddcb7db Author: Kyle Auble <[email protected]> Date: Fri Oct 2 23:41:09 2020 +0000 cmake: Raise error level of missing gtk-doc deps diff --git a/CMakeLists.txt b/CMakeLists.txt index b506cf8b..ee36242d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,16 +206,14 @@ if(ENABLE_GTK_DOC) # Disable gtk-doc generation & warn if the package is missing find_package(GtkDoc) if(NOT GtkDoc_FOUND) - message("-- Warning: Install the gtk-doc package to generate GTK API documentation") - set(ENABLE_GTK_DOC OFF) + message(FATAL_ERROR "Install the gtk-doc package to generate GTK API documentation") endif() # NOTE: These Find<...> modules are deprecated, but the newer FindPython3 module requires CMake >=3.12 find_package(PythonInterp 3) find_package(PythonLibs 3) # Also disable gtk-doc generation & raise a warning if Python3 is missing if(NOT (PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)) - message("-- Warning: ENABLE_GTK_DOC requires a python3 interpreter and libraries.") - set(ENABLE_GTK_DOC OFF) + message(FATAL_ERROR "ENABLE_GTK_DOC requires a python3 interpreter and libraries.") endif() endif() commit 327a7ce092397bc2ddb8a35eca52ab2b3f3bb858 Author: Kyle Auble <[email protected]> Date: Fri Sep 4 15:07:36 2020 -0400 cmake: Reorganize GObject introspection config * Fixes #958, separating scanner args enables warnings diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt index 75402ccd..fd76b150 100644 --- a/glib/CMakeLists.txt +++ b/glib/CMakeLists.txt @@ -126,29 +126,37 @@ endmacro(_list_prefix) # GObject Introspection if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS) include(GObjectIntrospectionMacros) + + # General gir: Reset object-list for introspection & load tool args set(INTROSPECTION_GIRS) - set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR} --warn-all") + set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all") set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}") - set(introspection_files ${poppler_glib_SRCS} ${poppler_glib_public_headers}) + # Poppler: Assign package to gir & export keys set(Poppler_0_18_gir "poppler-glib") - set(Poppler_0_18_gir_INCLUDES GObject-2.0 Gio-2.0 cairo-1.0) + set(Poppler_0_18_gir_EXPORT_PACKAGES "poppler-glib") + # Then load library and header lists + set(Poppler_0_18_gir_LIBS "poppler-glib" "poppler") + set(Poppler_0_18_gir_INCLUDES "GObject-2.0" "Gio-2.0" "cairo-1.0") + + # Format list of include directories as compiler flags get_directory_property(_tmp_includes INCLUDE_DIRECTORIES) _list_prefix(_includes _tmp_includes "-I") + # And set flags for gir compiler and scanner set(Poppler_0_18_gir_CFLAGS ${_includes} -L${CMAKE_BINARY_DIR} -L${CMAKE_CURRENT_BINARY_DIR}) - set(Poppler_0_18_gir_LIBS poppler-glib poppler) - _list_prefix(_abs_introspection_files introspection_files "${CMAKE_CURRENT_SOURCE_DIR}/") - list(APPEND _abs_introspection_files - ${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.c - ${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.h - ${CMAKE_CURRENT_BINARY_DIR}/poppler-features.h - ) - set(Poppler_0_18_gir_FILES ${_abs_introspection_files}) - set(Poppler_0_18_gir_SCANNERFLAGS --c-include poppler.h) - set(Poppler_0_18_gir_EXPORT_PACKAGES poppler-glib) - + set(Poppler_0_18_gir_SCANNERFLAGS "--c-include=poppler.h") + + # Load temporary source-file lists, including a few generated at build + set(orig_introspect_srcs ${poppler_glib_SRCS} ${poppler_glib_public_headers}) + set(gen_introspect_srcs "poppler-enums.c" "poppler-enums.h" "poppler-features.h") + # Prefix the files with their correct directories for full paths + _list_prefix(_orig_introspect_paths orig_introspect_srcs "${CMAKE_CURRENT_SOURCE_DIR}/") + _list_prefix(_gen_introspect_paths gen_introspect_srcs "${CMAKE_CURRENT_BINARY_DIR}/") + # Now load them to the final file list + set(Poppler_0_18_gir_FILES ${_orig_introspect_paths} ${_gen_introspect_paths}) + + # Finally, load the list of objects for introspection & invoke macro list(APPEND INTROSPECTION_GIRS Poppler-0.18.gir) - gir_add_introspections(INTROSPECTION_GIRS) endif () commit ff2130725ce43604323931cf8a365dad9ba93036 Author: Kyle Auble <[email protected]> Date: Sun Sep 6 20:03:16 2020 -0400 cmake: Add some checks for gtk-doc support * Fixes #956 (at least on Poppler's end) * Explicitly check for gtk-doc package also diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f035b8d..b506cf8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,6 +200,25 @@ else() set(CAIRO_FEATURE "#undef POPPLER_HAS_CAIRO") set(ENABLE_GLIB OFF) endif() + +# GTK API docs require both the gtk-doc package & python3 support +if(ENABLE_GTK_DOC) + # Disable gtk-doc generation & warn if the package is missing + find_package(GtkDoc) + if(NOT GtkDoc_FOUND) + message("-- Warning: Install the gtk-doc package to generate GTK API documentation") + set(ENABLE_GTK_DOC OFF) + endif() + # NOTE: These Find<...> modules are deprecated, but the newer FindPython3 module requires CMake >=3.12 + find_package(PythonInterp 3) + find_package(PythonLibs 3) + # Also disable gtk-doc generation & raise a warning if Python3 is missing + if(NOT (PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)) + message("-- Warning: ENABLE_GTK_DOC requires a python3 interpreter and libraries.") + set(ENABLE_GTK_DOC OFF) + endif() +endif() + if(ENABLE_CPP) macro_optional_find_package(Iconv) set(ENABLE_CPP ${ICONV_FOUND}) commit c5d85017f5cbc6487327d3de73fbab1c64b6af50 Author: Kyle Auble <[email protected]> Date: Fri Sep 4 18:32:06 2020 -0400 cmake: Note built-in Find<...> modules for later * See #955 for details * FindGLIB: Also fix minor case-sensitivity warning diff --git a/cmake/modules/FindFontconfig.cmake b/cmake/modules/FindFontconfig.cmake index 268a61ae..375bf7a0 100644 --- a/cmake/modules/FindFontconfig.cmake +++ b/cmake/modules/FindFontconfig.cmake @@ -11,6 +11,8 @@ # 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) diff --git a/cmake/modules/FindGLIB.cmake b/cmake/modules/FindGLIB.cmake index 68efd347..d54ec4b4 100644 --- a/cmake/modules/FindGLIB.cmake +++ b/cmake/modules/FindGLIB.cmake @@ -21,4 +21,4 @@ else() pkg_check_modules(GLIB2 IMPORTED_TARGET "glib-2.0>=${GLIB_REQUIRED}" "gobject-2.0>=${GLIB_REQUIRED}" "gio-2.0>=${GLIB_REQUIRED}") endif() -find_package_handle_standard_args(GLib DEFAULT_MSG GLIB2_LIBRARIES GLIB2_CFLAGS) +find_package_handle_standard_args(GLIB DEFAULT_MSG GLIB2_LIBRARIES GLIB2_CFLAGS) diff --git a/cmake/modules/FindGTK.cmake b/cmake/modules/FindGTK.cmake index 86af910c..3cc78438 100644 --- a/cmake/modules/FindGTK.cmake +++ b/cmake/modules/FindGTK.cmake @@ -10,6 +10,8 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# NOTE: As of cmake v3.18, built-in FindGTK is *only* valid for GTK1 + include(FindPackageHandleStandardArgs) find_package(PkgConfig REQUIRED) diff --git a/cmake/modules/FindIconv.cmake b/cmake/modules/FindIconv.cmake index 338d17d0..ab9ad563 100644 --- a/cmake/modules/FindIconv.cmake +++ b/cmake/modules/FindIconv.cmake @@ -6,6 +6,10 @@ # 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) _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
