On 04/09/17 06:10, Albert Astals Cid wrote: > El diumenge, 3 de setembre de 2017, a les 10:25:20 CEST, Adrian Johnson va > escriure: >> On 03/09/17 01:45, Albert Astals Cid wrote: >>> If configure supports this and you really think it's a must i guess we >>> could add it, but I personally think its a good idea to have a build with >>> everything configured, build selectively what you want (i.e. make >>> pdfinfo) and then just run a final make to make sure you didn't break >>> something else by chance. >> I think it is a good idea. The problem with "make pdfinfo" is I often >> run multiple utils when testing. If I ran "make pdftocairo", I may run >> pdfinfo forgetting that I didn't rebuild it. >> >> I've attached a patch to implement this. > > Why > if (ENABLE_QT4 OR ENABLE_QT5) > ?
Here is an updated patch.
>From ea04cab5d366feb638abf41d36967cacae4a5786 Mon Sep 17 00:00:00 2001 From: Adrian Johnson <[email protected]> Date: Tue, 5 Sep 2017 20:55:45 +0930 Subject: [PATCH] cmake: add options to disable glib/qt4/qt5 --- CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) 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) -- 2.11.0
_______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
