[poppler] CMakeLists.txt

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Sep 5 17:46:33 UTC 2017


 CMakeLists.txt |   54 ++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 34 insertions(+), 20 deletions(-)

New commits:
commit 766a32ff59dadd9ae4639d8a79861a17be6aec52
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Tue Sep 5 20:55:45 2017 +0930

    cmake: add options to disable glib/qt4/qt5

diff --git a/CMakeLists.txt b/CMakeLists.txt
index defb215f..f557bdaf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,9 @@ option(BUILD_CPP_TESTS "Whether compile the CPP test programs." ON)
 option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
 option(ENABLE_UTILS "Compile poppler command line utils." ON)
 option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
+option(ENABLE_GLIB "Compile poppler glib wrapper." ON)
+option(ENABLE_QT4 "Compile poppler qt4 wrapper." ON)
+option(ENABLE_QT5 "Compile poppler qt5 wrapper." ON)
 set(ENABLE_LIBOPENJPEG "auto" CACHE STRING "Use libopenjpeg for JPX streams. Possible values: auto, openjpeg1, openjpeg2, unmaintained, none. 'auto' prefers openjpeg2 over openjpeg1 if both are available. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no JPX decoder at all. Default: auto")
 set(ENABLE_CMS "auto" CACHE STRING "Use color management system. Possible values: auto, lcms1, lcms2. 'auto' prefers lcms2 over lcms1 if both are available. Unset to disable color management system.")
 set(ENABLE_DCTDECODER "libjpeg" CACHE STRING "Use libjpeg for DCT streams. Possible values: libjpeg, unmaintained, none. will use libjpeg if available or fail if not. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no DCT decoder at all. Default: libjpeg")
@@ -129,17 +132,24 @@ elseif(ENABLE_DCTDECODER STREQUAL "none")
 else()
   message(FATAL_ERROR "Invalid ENABLE_DCTDECODER value.")
 endif()
-macro_optional_find_package(Qt4)
-find_package(Qt5Core)
-find_package(Qt5Gui)
-find_package(Qt5Xml)
-find_package(Qt5Widgets)
-find_package(Qt5Test)
-if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
-  set(QT5_FOUND true)
-else ()
-  message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
-  set(QT5_FOUND false)
+
+if (ENABLE_QT4)
+  macro_optional_find_package(Qt4)
+  if (NOT QT4_FOUND)
+    set(ENABLE_QT4 OFF)
+  endif()
+endif()
+
+if (ENABLE_QT5)
+  find_package(Qt5Core)
+  find_package(Qt5Gui)
+  find_package(Qt5Xml)
+  find_package(Qt5Widgets)
+  find_package(Qt5Test)
+  if (NOT (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND))
+    message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
+    set(ENABLE_QT5 OFF)
+  endif()
 endif()
 
 macro_optional_find_package(Cairo ${CAIRO_VERSION})
@@ -149,9 +159,13 @@ if(CAIRO_FOUND)
   set(CAIRO_REQ "cairo")
   set(POPPLER_GLIB_DISABLE_DEPRECATED "")
   set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "")
-  macro_optional_find_package(GLIB)
-  if(GLIB_FOUND)
-    set(ENABLE_GLIB ON)
+  if(ENABLE_GLIB)
+    macro_optional_find_package(GLIB)
+    if(NOT GLIB_FOUND)
+      set(ENABLE_GLIB OFF)
+    endif()
+  endif()
+  if(ENABLE_GLIB)
     # Check for introspection
     macro_optional_find_package(GObjectIntrospection 0.9.12)
     set(HAVE_INTROSPECTION ${INTROSPECTION_FOUND})
@@ -716,10 +730,10 @@ if(ENABLE_GLIB)
   add_subdirectory(glib)
 endif()
 add_subdirectory(test)
-if(QT4_FOUND)
+if(ENABLE_QT4)
   add_subdirectory(qt4)
 endif()
-if(QT5_FOUND)
+if(ENABLE_QT5)
   add_subdirectory(qt5)
 endif()
 if(ENABLE_CPP)
@@ -743,10 +757,10 @@ poppler_create_install_pkgconfig(poppler.pc lib${LIB_SUFFIX}/pkgconfig)
 if(ENABLE_SPLASH)
   poppler_create_install_pkgconfig(poppler-splash.pc lib${LIB_SUFFIX}/pkgconfig)
 endif()
-if(QT4_FOUND)
+if(ENABLE_QT4)
   poppler_create_install_pkgconfig(poppler-qt4.pc lib${LIB_SUFFIX}/pkgconfig)
 endif()
-if(QT5_FOUND)
+if(ENABLE_QT5)
   poppler_create_install_pkgconfig(poppler-qt5.pc lib${LIB_SUFFIX}/pkgconfig)
 endif()
 if(ENABLE_GLIB)
@@ -767,8 +781,8 @@ if(SPLASH_CMYK)
   message("      with CMYK support")
 endif()
 show_end_message_yesno("cairo output" CAIRO_FOUND)
-show_end_message_yesno("qt4 wrapper" QT4_FOUND)
-show_end_message_yesno("qt5 wrapper" QT5_FOUND)
+show_end_message_yesno("qt4 wrapper" ENABLE_QT4)
+show_end_message_yesno("qt5 wrapper" ENABLE_QT5)
 show_end_message_yesno("glib wrapper" ENABLE_GLIB)
 show_end_message_yesno("  introspection" INTROSPECTION_FOUND)
 show_end_message_yesno("cpp wrapper" ENABLE_CPP)


More information about the poppler mailing list