Enable CUPS auto detection on Windows
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>
Wed, 18 Jul 2012 13:37:21 +0000 (15:37 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 19 Jul 2012 13:28:18 +0000 (15:28 +0200)
Detect CUPS availability automatically when cross-compiling from a Windows
host.

Change-Id: Ife9bb90732c39794a7b760ced4aaea232612fe54
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
tools/configure/configureapp.cpp

index 06ddefa..384079f 100644 (file)
@@ -238,6 +238,7 @@ Configure::Configure(int& argc, char** argv)
     dictionary[ "POSIX_IPC" ]       = "no";
     dictionary[ "QT_GLIB" ]         = "no";
     dictionary[ "QT_ICONV" ]        = "auto";
+    dictionary[ "QT_CUPS" ]         = "auto";
 
     //Only used when cross compiling.
     dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg";
@@ -2096,6 +2097,8 @@ bool Configure::checkAvailability(const QString &part)
         available = findFile("dwrite.h") && findFile("d2d1.h") && findFile("dwrite.lib");
     } else if (part == "ICONV") {
         available = tryCompileProject("unix/iconv") || tryCompileProject("unix/gnu-libiconv");
+    } else if (part == "CUPS") {
+        available = (platform() != WINDOWS) && (platform() != WINDOWS_CE) && tryCompileProject("unix/cups");
     }
 
     return available;
@@ -2199,6 +2202,10 @@ void Configure::autoDetection()
     if (dictionary["QT_ICONV"] == "auto")
         dictionary["QT_ICONV"] = checkAvailability("ICONV") ? "yes" : "no";
 
+    // Detection of iconv support
+    if (dictionary["QT_CUPS"] == "auto")
+        dictionary["QT_CUPS"] = checkAvailability("CUPS") ? "yes" : "no";
+
     // Mark all unknown "auto" to the default value..
     for (QMap<QString,QString>::iterator i = dictionary.begin(); i != dictionary.end(); ++i) {
         if (i.value() == "auto")
@@ -3304,6 +3311,7 @@ void Configure::displayConfig()
     sout << "NIS support................." << dictionary[ "NIS" ] << endl;
     sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl;
     sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl;
+    sout << "CUPS support................" << dictionary[ "QT_CUPS" ] << endl;
     if (dictionary.value(QStringLiteral("OPENGL_ES_2")) == QStringLiteral("yes")) {
         const QString angleDir = dictionary.value(QStringLiteral("ANGLE_DIR"));
         if (!angleDir.isEmpty())