diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-03-04 21:32:40 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-03-04 21:45:05 +0100 |
commit | 96232be1466e8c059c270b611ce7c32997ff60a9 (patch) | |
tree | 9bf47c0c2c84556415eee7f938a098ae7e542649 /qmake | |
parent | 8db8a34f07a2f8cbd06dc0b593886a13d52ae4b1 (diff) | |
parent | fb8c95bac09910c4dfa476ab97c6206b2e94ee53 (diff) |
Merge remote-tracking branch 'origin/api_changes'
Conflicts:
dist/changes-5.0.0
mkspecs/features/qt_module_config.prf
qmake/project.cpp
qmake/property.cpp
Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/integrity/gbuild.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/makefiledeps.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.h | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 10 | ||||
-rw-r--r-- | qmake/option.cpp | 2 | ||||
-rw-r--r-- | qmake/option.h | 23 | ||||
-rw-r--r-- | qmake/project.cpp | 14 | ||||
-rw-r--r-- | qmake/property.cpp | 84 | ||||
-rw-r--r-- | qmake/property.h | 4 |
12 files changed, 71 insertions, 82 deletions
diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index c72c120f39..895df24193 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -213,7 +213,7 @@ GBuildMakefileGenerator::write() dllbase += DLLOFFSET; } - warn_msg(WarnParser, Option::output.fileName().toAscii()); + warn_msg(WarnParser, Option::output.fileName().toAscii().constData()); QTextStream t(&Option::output); QString primaryTarget(project->values("QMAKE_CXX").at(0)); @@ -425,7 +425,7 @@ GBuildMakefileGenerator::openOutput(QFile &file, const QString &build) const outputName += QDir::separator(); outputName += fileInfo(project->projectFile()).baseName(); outputName += projectSuffix(); - warn_msg(WarnParser, outputName.toAscii()); + warn_msg(WarnParser, outputName.toAscii().constData()); file.setFileName(outputName); } debug_msg(1, "file is %s", file.fileName().toLatin1().constData()); diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 5d6dee1bb9..70efff0bcd 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1378,7 +1378,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } tmp = project->values("QMAKE_PBX_VARS"); for(int i = 0; i < tmp.count(); i++) { - QString var = tmp[i], val = qgetenv(var.toLatin1()); + QString var = tmp[i], val = QString::fromAscii(qgetenv(var.toLatin1().constData())); if(val.isEmpty() && var == "TB") val = "/usr/bin/"; t << "\t\t\t\t" << writeSettings(var, escapeFilePath(val)) << ";" << "\n"; diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 8544dce2fc..63367f116a 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3174,7 +3174,7 @@ MakefileGenerator::pkgConfigPrefix() const { if(!project->isEmpty("QMAKE_PKGCONFIG_PREFIX")) return project->first("QMAKE_PKGCONFIG_PREFIX"); - return QLibraryInfo::location(QLibraryInfo::PrefixPath); + return QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath); } QString diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index d28d48b4d0..642dd97e68 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -185,9 +185,9 @@ SourceFile *SourceFiles::lookupFile(const char *file) void SourceFiles::addFile(SourceFile *p, const char *k, bool own_file) { - QByteArray ba = p->file.local().toLatin1(); + const QByteArray ba = p->file.local().toLatin1(); if(!k) - k = ba; + k = ba.constData(); int h = hash(k) % num_nodes; SourceFileNode *pn = new SourceFileNode; pn->own_file = own_file; diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 81f541f94e..e0f55a64c9 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1615,7 +1615,7 @@ bool VCLinkerTool::parseOption(const char* option) { // Split up in subsystem, and version number QStringList both = QString(option+11).split(","); - switch (elfHash(both[0].toLatin1())) { + switch (elfHash(both[0].toLatin1().constData())) { case 0x8438445: // CONSOLE SubSystem = subSystemConsole; break; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 8b1cf519ff..37d923f9c1 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -477,7 +477,7 @@ protected: public: void parseOptions(QStringList& options) { for (QStringList::ConstIterator it=options.begin(); (it!=options.end()); it++) - parseOption((*it).toLatin1()); + parseOption((*it).toLatin1().constData()); } static QStringList fixCommandLine(const QString &input); }; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 109b50fd94..434d4b4559 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1575,11 +1575,11 @@ QString VcprojGenerator::findTemplate(QString file) QString ret; if(!exists((ret = file)) && !exists((ret = QString(Option::mkfile::qmakespec + "/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc.net/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2002/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2003/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2005/" + file))) && - !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2008/" + file)))) + !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc.net/" + file))) && + !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2002/" + file))) && + !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2003/" + file))) && + !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2005/" + file))) && + !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::HostDataPath) + "/win32-msvc2008/" + file)))) return ""; debug_msg(1, "Generator: MSVC.NET: Found template \'%s\'", ret.toLatin1().constData()); return ret; diff --git a/qmake/option.cpp b/qmake/option.cpp index cf72351f1f..4e0d5b198e 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -594,7 +594,7 @@ QStringList Option::mkspecPaths() ret << Option::mkfile::project_build_root + concat; if (!Option::mkfile::project_root.isEmpty()) ret << Option::mkfile::project_root + concat; - ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat; + ret << QLibraryInfo::location(QLibraryInfo::HostDataPath) + concat; return ret; } diff --git a/qmake/option.h b/qmake/option.h index 2d0d1114a9..23384877fd 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -46,6 +46,7 @@ #include <qstring.h> #include <qstringlist.h> #include <qfile.h> +#include <qlibraryinfo.h> QT_BEGIN_NAMESPACE @@ -219,28 +220,6 @@ private: inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); } inline QStringList splitPathList(const QString &paths) { return paths.split(Option::dirlist_sep); } -// this is a stripped down version of the one found in QtCore -class QLibraryInfo -{ -public: - enum LibraryLocation - { - PrefixPath, - DocumentationPath, - HeadersPath, - LibrariesPath, - BinariesPath, - PluginsPath, - DataPath, - TranslationsPath, - SettingsPath, - ExamplesPath, - ImportsPath, - TestsPath - }; - static QString location(LibraryLocation); -}; - QT_END_NAMESPACE #endif // OPTION_H diff --git a/qmake/project.cpp b/qmake/project.cpp index 34e443f5c5..f6e26254c5 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -591,7 +591,7 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0) } for(QStringList::Iterator concat_it = concat.begin(); concat_it != concat.end(); ++concat_it) - feature_roots << (QLibraryInfo::location(QLibraryInfo::DataPath) + + feature_roots << (QLibraryInfo::location(QLibraryInfo::HostDataPath) + mkspecs_concat + (*concat_it)); return feature_roots; } @@ -1435,7 +1435,7 @@ QMakeProject::resolveSpec(QString *spec, const QString &qmakespec) if (*spec == "default") { #ifdef Q_OS_UNIX char buffer[1024]; - int l = readlink(qmakespec.toLatin1(), buffer, 1023); + int l = readlink(qmakespec.toLatin1().constData(), buffer, 1023); if (l != -1) { buffer[l] = '\0'; *spec = QString::fromLatin1(buffer); @@ -1988,7 +1988,7 @@ QMakeProject::doProjectExpand(QString func, QList<QStringList> args_list, if(args.count() > 1) singleLine = (args[1].toLower() == "true"); QString output; - FILE *proc = QT_POPEN(args[0].toLatin1(), "r"); + FILE *proc = QT_POPEN(args[0].toLatin1().constData(), "r"); while(proc && !feof(proc)) { int read_in = int(fread(buff, 1, 255, proc)); if(!read_in) @@ -3061,19 +3061,19 @@ QStringList &QMakeProject::values(const QString &_var, QHash<QString, QStringLis place[var] = QStringList(Option::fixPathToTargetOS( !Option::qmake_abslocation.isEmpty() ? Option::qmake_abslocation - : QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake", + : QLibraryInfo::location(QLibraryInfo::HostBinariesPath) + "/qmake", false)); } #if defined(Q_OS_WIN32) && defined(Q_CC_MSVC) else if(var.startsWith(QLatin1String("QMAKE_TARGET."))) { QString ret, type = var.mid(13); if(type == "arch") { - QString paths = qgetenv("PATH"); - QString vcBin64 = qgetenv("VCINSTALLDIR"); + QString paths = QString::fromLocal8Bit(qgetenv("PATH")); + QString vcBin64 = QString::fromLocal8Bit(qgetenv("VCINSTALLDIR")); if (!vcBin64.endsWith('\\')) vcBin64.append('\\'); vcBin64.append("bin\\amd64"); - QString vcBinX86_64 = qgetenv("VCINSTALLDIR"); + QString vcBinX86_64 = QString::fromLocal8Bit(qgetenv("VCINSTALLDIR")); if (!vcBinX86_64.endsWith('\\')) vcBinX86_64.append('\\'); vcBinX86_64.append("bin\\x86_amd64"); diff --git a/qmake/property.cpp b/qmake/property.cpp index 064c8f6082..8ed9462c60 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -49,8 +49,48 @@ QT_BEGIN_NAMESPACE +static const struct { + const char *name; + QLibraryInfo::LibraryLocation loc; + bool raw; +} propList[] = { + { "QT_SYSROOT", QLibraryInfo::SysrootPath, true }, + { "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false }, + { "QT_INSTALL_DATA", QLibraryInfo::DataPath, false }, + { "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false }, + { "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false }, + { "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false }, + { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false }, + { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false }, + { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false }, + { "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false }, + { "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false }, + { "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 }, +}; + 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); } QMakeProperty::~QMakeProperty() @@ -78,32 +118,9 @@ QMakeProperty::keyBase(bool version) const QString QMakeProperty::value(QString v, bool just_check) { - if(v == "QT_INSTALL_PREFIX") - return QLibraryInfo::location(QLibraryInfo::PrefixPath); - else if(v == "QT_INSTALL_DATA") - return QLibraryInfo::location(QLibraryInfo::DataPath); - else if(v == "QT_INSTALL_DOCS") - return QLibraryInfo::location(QLibraryInfo::DocumentationPath); - else if(v == "QT_INSTALL_HEADERS") - return QLibraryInfo::location(QLibraryInfo::HeadersPath); - else if(v == "QT_INSTALL_LIBS") - return QLibraryInfo::location(QLibraryInfo::LibrariesPath); - else if(v == "QT_INSTALL_BINS") - return QLibraryInfo::location(QLibraryInfo::BinariesPath); - else if(v == "QT_INSTALL_TESTS") - return QLibraryInfo::location(QLibraryInfo::TestsPath); - else if(v == "QT_INSTALL_PLUGINS") - return QLibraryInfo::location(QLibraryInfo::PluginsPath); - else if(v == "QT_INSTALL_IMPORTS") - return QLibraryInfo::location(QLibraryInfo::ImportsPath); - else if(v == "QT_INSTALL_TRANSLATIONS") - return QLibraryInfo::location(QLibraryInfo::TranslationsPath); - else if(v == "QT_INSTALL_CONFIGURATION") - return QLibraryInfo::location(QLibraryInfo::SettingsPath); - else if(v == "QT_INSTALL_EXAMPLES") - return QLibraryInfo::location(QLibraryInfo::ExamplesPath); - else if(v == "QT_INSTALL_DEMOS") - return QLibraryInfo::location(QLibraryInfo::ExamplesPath); + QString val = m_values.value(v); + if (!val.isNull()) + return val; else if(v == "QMAKE_MKSPECS") return Option::mkspecPaths().join(Option::dirlist_sep); else if(v == "QMAKE_VERSION") @@ -192,19 +209,8 @@ QMakeProperty::exec() } } QStringList specialProps; - specialProps.append("QT_INSTALL_PREFIX"); - specialProps.append("QT_INSTALL_DATA"); - specialProps.append("QT_INSTALL_DOCS"); - specialProps.append("QT_INSTALL_HEADERS"); - specialProps.append("QT_INSTALL_LIBS"); - specialProps.append("QT_INSTALL_BINS"); - specialProps.append("QT_INSTALL_TESTS"); - specialProps.append("QT_INSTALL_PLUGINS"); - specialProps.append("QT_INSTALL_IMPORTS"); - specialProps.append("QT_INSTALL_TRANSLATIONS"); - specialProps.append("QT_INSTALL_CONFIGURATION"); - specialProps.append("QT_INSTALL_EXAMPLES"); - specialProps.append("QT_INSTALL_DEMOS"); + for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) + specialProps.append(QString::fromLatin1(propList[i].name)); specialProps.append("QMAKE_MKSPECS"); specialProps.append("QMAKE_VERSION"); #ifdef QT_VERSION_STR diff --git a/qmake/property.h b/qmake/property.h index d67d0ad09d..6195e482fb 100644 --- a/qmake/property.h +++ b/qmake/property.h @@ -44,6 +44,7 @@ #include <qglobal.h> #include <qstring.h> +#include <qhash.h> QT_BEGIN_NAMESPACE @@ -55,6 +56,9 @@ class QMakeProperty void initSettings(); QString keyBase(bool =true) const; QString value(QString, bool just_check); + + QHash<QString, QString> m_values; + public: QMakeProperty(); ~QMakeProperty(); |