summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32/msvc_vcproj.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/win32/msvc_vcproj.cpp')
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp44
1 files changed, 17 insertions, 27 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index b228917692..606fee6dd0 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -379,12 +379,12 @@ QUuid VcprojGenerator::increaseUUID(const QUuid &id)
QStringList VcprojGenerator::collectSubDirs(QMakeProject *proj)
{
QStringList subdirs;
- QStringList tmp_proj_subdirs = proj->variables()["SUBDIRS"];
+ QStringList tmp_proj_subdirs = proj->values("SUBDIRS");
for(int x = 0; x < tmp_proj_subdirs.size(); ++x) {
QString tmpdir = tmp_proj_subdirs.at(x);
const QString tmpdirConfig = tmpdir + QStringLiteral(".CONFIG");
if (!proj->isEmpty(tmpdirConfig)) {
- const QStringList config = proj->variables().value(tmpdirConfig);
+ const QStringList config = proj->values(tmpdirConfig);
if (config.contains(QStringLiteral("no_default_target")))
continue; // Ignore this sub-dir
}
@@ -463,7 +463,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
if(tmp_proj.read(fn)) {
// Check if all requirements are fulfilled
- if(!tmp_proj.variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
+ if (!tmp_proj.isEmpty("QMAKE_FAILED_REQUIREMENTS")) {
fprintf(stderr, "Project file(%s) not added to Solution because all requirements not met:\n\t%s\n",
fn.toLatin1().constData(), tmp_proj.values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
continue;
@@ -483,16 +483,6 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
tmp_vcproj.setProjectFile(&tmp_proj);
Option::qmake_mode = old_mode;
Option::output_dir = old_output_dir;
- if(Option::debug_level) {
- debug_msg(1, "Dumping all variables:");
- QHash<QString, QStringList> &vars = tmp_proj.variables();
- for(QHash<QString, QStringList>::Iterator it = vars.begin();
- it != vars.end(); ++it) {
- if(it.key().left(1) != "." && !it.value().isEmpty())
- debug_msg(1, "%s: %s === %s", fn.toLatin1().constData(), it.key().toLatin1().constData(),
- it.value().join(" :: ").toLatin1().constData());
- }
- }
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"));
@@ -536,17 +526,17 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
// All ActiveQt Server projects are dependent on idc.exe
- if(tmp_proj.variables()["CONFIG"].contains("qaxserver"))
+ if (tmp_proj.values("CONFIG").contains("qaxserver"))
newDep->dependencies << "idc.exe";
// All extra compilers which has valid input are considered dependencies
- const QStringList &quc = tmp_proj.variables()["QMAKE_EXTRA_COMPILERS"];
+ const QStringList &quc = tmp_proj.values("QMAKE_EXTRA_COMPILERS");
for(QStringList::ConstIterator it = quc.constBegin(); it != quc.constEnd(); ++it) {
- const QStringList &invar = tmp_proj.variables().value((*it) + ".input");
+ const QStringList &invar = tmp_proj.values(*it + ".input");
for(QStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
- const QStringList fileList = tmp_proj.variables().value(*iit);
+ const QStringList fileList = tmp_proj.values(*iit);
if (!fileList.isEmpty()) {
- const QStringList &cmdsParts = tmp_proj.variables().value((*it) + ".commands");
+ const QStringList &cmdsParts = tmp_proj.values(*it + ".commands");
bool startOfLine = true;
foreach(QString cmd, cmdsParts) {
if (!startOfLine) {
@@ -575,11 +565,11 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
// Add all unknown libs to the deps
QStringList where = QStringList() << "QMAKE_LIBS" << "QMAKE_LIBS_PRIVATE";
if(!tmp_proj.isEmpty("QMAKE_INTERNAL_PRL_LIBS"))
- where = tmp_proj.variables()["QMAKE_INTERNAL_PRL_LIBS"];
- for(QStringList::iterator wit = where.begin();
+ where = tmp_proj.values("QMAKE_INTERNAL_PRL_LIBS");
+ for (QStringList::ConstIterator wit = where.begin();
wit != where.end(); ++wit) {
- QStringList &l = tmp_proj.variables()[(*wit)];
- for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ const QStringList &l = tmp_proj.values(*wit);
+ for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
QString opt = (*it);
if(!opt.startsWith("/") && // Not a switch
opt != newDep->target && // Not self
@@ -767,10 +757,10 @@ void VcprojGenerator::init()
// unless the compiler is configure as a combined stage, then use the first one
const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for(QStringList::ConstIterator it = quc.constBegin(); it != quc.constEnd(); ++it) {
- const QStringList &invar = project->variables().value((*it) + ".input");
+ const QStringList &invar = project->values(*it + ".input");
const QString compiler_out = project->first((*it) + ".output");
for(QStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
- QStringList fileList = project->variables().value(*iit);
+ QStringList fileList = project->values(*iit);
if (!fileList.isEmpty()) {
if (project->values((*it) + ".CONFIG").indexOf("combine") != -1)
fileList = QStringList(fileList.first());
@@ -1112,7 +1102,7 @@ void VcprojGenerator::initDeploymentTool()
// Only deploy Qt libs for shared build
if (!project->values("QMAKE_QT_DLL").isEmpty()) {
- QStringList& arg = project->values("MSVCPROJ_LIBS");
+ const QStringList &arg = project->values("MSVCPROJ_LIBS");
for (QStringList::ConstIterator it = arg.constBegin(); it != arg.constEnd(); ++it) {
if (it->contains(project->first("QMAKE_LIBDIR"))) {
QString dllName = *it;
@@ -1471,8 +1461,8 @@ void VcprojGenerator::initOld()
// $$QMAKE.. -> $$MSVCPROJ.. -------------------------------------
project->values("MSVCPROJ_LIBS") += project->values("QMAKE_LIBS");
project->values("MSVCPROJ_LIBS") += project->values("QMAKE_LIBS_PRIVATE");
- QStringList &incs = project->values("INCLUDEPATH");
- for(QStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) {
+ const QStringList &incs = project->values("INCLUDEPATH");
+ for (QStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
QString inc = (*incit);
if (!inc.startsWith('"') && !inc.endsWith('"'))
inc = QString("\"%1\"").arg(inc); // Quote all paths if not quoted already