summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Auble <kyle.auble@outlook.com>2020-09-06 20:03:16 -0400
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-10-01 20:44:52 +0000
commitff2130725ce43604323931cf8a365dad9ba93036 (patch)
tree5f03c480203b3395a646c065c081b703aeea3a52
parentc5d85017f5cbc6487327d3de73fbab1c64b6af50 (diff)
cmake: Add some checks for gtk-doc support
* Fixes #956 (at least on Poppler's end) * Explicitly check for gtk-doc package also
-rw-r--r--CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
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})