QT_RAW_INSTALL_FOO => QT_INSTALL_FOO/raw
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Fri, 9 Mar 2012 18:11:27 +0000 (19:11 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 12 Mar 2012 10:01:02 +0000 (11:01 +0100)
this makes the "sysrootable" properties more magic, with the raw
versions being omitted from the qmake -query output and automatically
falling back to the "cooked" variant if there is no sysroot set.

this makes the "normal" qmake -query less noisy. this will become even
more obvious when i add more "overloads" of the properties.

Change-Id: I08000986427264ec6238c8fe0a77f5cecdbf1201
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
dist/changes-5.0.0
mkspecs/features/qt_module_config.prf
qmake/project.cpp
qmake/property.cpp

index 97aa7bd..ba1adde 100644 (file)
@@ -207,7 +207,7 @@ information about a particular change.
     an entirely pristine context.
   * Configure's -sysroot and -hostprefix are now handled slightly differently.
     The QT_INSTALL_... properties are now automatically prefixed with the sysroot;
-    the raw values are available as QT_RAW_INSTALL_... and the sysroot as QT_SYSROOT.
+    the raw values are available as QT_INSTALL_.../raw and the sysroot as QT_SYSROOT.
     The new QT_HOST_... properties can be used to refer to the Qt host tools.
   * Several functions and built-in variables were modified to return normalized paths.
 
index 98cdab1..cae5f47 100644 (file)
@@ -118,24 +118,24 @@ load(qt_installs)
 
 unix|win32-g++* {
    CONFIG += create_pc
-   QMAKE_PKGCONFIG_LIBDIR = $$[QT_RAW_INSTALL_LIBS]
-   QMAKE_PKGCONFIG_INCDIR = $$[QT_RAW_INSTALL_HEADERS]/$$TARGET
-   QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_RAW_INSTALL_HEADERS]
+   QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
+   QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]/$$TARGET
+   QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS/raw]
    QMAKE_PKGCONFIG_DESTDIR = pkgconfig
    include_replace.match = $$QMAKE_INCDIR_QT
-   include_replace.replace = $$[QT_RAW_INSTALL_HEADERS]
+   include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
    lib_replace.match = $$QMAKE_LIBDIR_QT
-   lib_replace.replace = $$[QT_RAW_INSTALL_LIBS]
+   lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
    prefix_replace.match = $$QT_BUILD_TREE
-   prefix_replace.replace = $$[QT_RAW_INSTALL_PREFIX]
+   prefix_replace.replace = $$[QT_INSTALL_PREFIX/raw]
    QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace
 }
 
 unix {
    CONFIG += create_libtool explicitlib
-   QMAKE_PRL_LIBDIR = $$[QT_RAW_INSTALL_LIBS] ### XXX
+   QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS/raw] ### XXX
    QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
-   QMAKE_LIBTOOL_LIBDIR = $$[QT_RAW_INSTALL_LIBS]
+   QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
    QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
 }
 
index 7655f05..8b5ed1e 100644 (file)
@@ -2782,7 +2782,7 @@ QMakeProject::doVariableReplaceExpand(const QString &str, QHash<QString, QString
                        unicode != DOT && unicode != UNDERSCORE &&
                        //unicode != SINGLEQUOTE && unicode != DOUBLEQUOTE &&
                        (unicode < 'a' || unicode > 'z') && (unicode < 'A' || unicode > 'Z') &&
-                       (unicode < '0' || unicode > '9'))
+                       (unicode < '0' || unicode > '9') && (!term || unicode != '/'))
                         break;
                     var.append(QChar(unicode));
                     if(++i == str_len)
index 8ed9462..1952b50 100644 (file)
@@ -68,18 +68,6 @@ static const struct {
     { "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false },
     { "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false },
     { "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false }, // Just backwards compat
-    { "QT_RAW_INSTALL_PREFIX", QLibraryInfo::PrefixPath, true },
-    { "QT_RAW_INSTALL_DATA", QLibraryInfo::DataPath, true },
-    { "QT_RAW_INSTALL_DOCS", QLibraryInfo::DocumentationPath, true },
-    { "QT_RAW_INSTALL_HEADERS", QLibraryInfo::HeadersPath, true },
-    { "QT_RAW_INSTALL_LIBS", QLibraryInfo::LibrariesPath, true },
-    { "QT_RAW_INSTALL_BINS", QLibraryInfo::BinariesPath, true },
-    { "QT_RAW_INSTALL_TESTS", QLibraryInfo::TestsPath, true },
-    { "QT_RAW_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, true },
-    { "QT_RAW_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, true },
-    { "QT_RAW_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, true },
-    { "QT_RAW_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, true },
-    { "QT_RAW_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, true },
     { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true },
     { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
     { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
@@ -87,10 +75,15 @@ static const struct {
 
 QMakeProperty::QMakeProperty() : settings(0)
 {
-    for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++)
-        m_values[QString::fromLatin1(propList[i].name)] = propList[i].raw
-                ? QLibraryInfo::rawLocation(propList[i].loc)
-                : QLibraryInfo::location(propList[i].loc);
+    for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) {
+        QString name = QString::fromLatin1(propList[i].name);
+        QString val = QLibraryInfo::rawLocation(propList[i].loc);
+        if (!propList[i].raw) {
+            m_values[name] = QLibraryInfo::location(propList[i].loc);
+            name += "/raw";
+        }
+        m_values[name] = val;
+    }
 }
 
 QMakeProperty::~QMakeProperty()
@@ -216,8 +209,13 @@ QMakeProperty::exec()
 #ifdef QT_VERSION_STR
             specialProps.append("QT_VERSION");
 #endif
-            foreach (QString prop, specialProps)
-                fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), value(prop).toLatin1().constData());
+            foreach (QString prop, specialProps) {
+                QString val = value(prop);
+                QString pval = value(prop + "/raw");
+                fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), val.toLatin1().constData());
+                if (!pval.isEmpty() && pval != val)
+                    fprintf(stdout, "%s/raw:%s\n", prop.toLatin1().constData(), pval.toLatin1().constData());
+            }
             return true;
         }
         for(QStringList::ConstIterator it = Option::prop::properties.begin();