From ff2130725ce43604323931cf8a365dad9ba93036 Mon Sep 17 00:00:00 2001 From: Kyle Auble Date: Sun, 6 Sep 2020 20:03:16 -0400 Subject: cmake: Add some checks for gtk-doc support * Fixes #956 (at least on Poppler's end) * Explicitly check for gtk-doc package also --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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}) -- cgit v1.2.3