summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix3
-rw-r--r--qmake/Makefile.win322
-rw-r--r--qmake/Makefile.win32-g++3
-rw-r--r--qmake/generators/integrity/gbuild.cpp51
-rw-r--r--qmake/generators/integrity/gbuild.h2
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp328
-rw-r--r--qmake/generators/mac/pbuilder_pbx.h15
-rw-r--r--qmake/generators/makefile.cpp937
-rw-r--r--qmake/generators/makefile.h28
-rw-r--r--qmake/generators/makefiledeps.cpp4
-rw-r--r--qmake/generators/makefiledeps.h4
-rw-r--r--qmake/generators/metamakefile.cpp42
-rw-r--r--qmake/generators/projectgenerator.cpp61
-rw-r--r--qmake/generators/projectgenerator.h2
-rw-r--r--qmake/generators/unix/unixmake.cpp137
-rw-r--r--qmake/generators/unix/unixmake.h1
-rw-r--r--qmake/generators/unix/unixmake2.cpp245
-rw-r--r--qmake/generators/win32/mingw_make.cpp66
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp42
-rw-r--r--qmake/generators/win32/msvc_nmake.h2
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp27
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h8
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp225
-rw-r--r--qmake/generators/win32/winmakefile.cpp144
-rw-r--r--qmake/generators/win32/winmakefile.h1
-rw-r--r--qmake/library/proitems.h225
-rw-r--r--qmake/library/qmake_global.h67
-rw-r--r--qmake/meta.cpp28
-rw-r--r--qmake/meta.h26
-rw-r--r--qmake/option.cpp30
-rw-r--r--qmake/project.cpp32
-rw-r--r--qmake/project.h41
-rw-r--r--qmake/property.cpp30
-rw-r--r--qmake/property.h9
-rw-r--r--qmake/qmake.pri4
-rw-r--r--qmake/qmake.pro1
36 files changed, 1678 insertions, 1195 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 62c2d0afc2..c888c518e0 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -7,6 +7,7 @@ QMAKESPEC = @QMAKESPEC@
LFLAGS = @QMAKE_LFLAGS@
QMKSRC = $(SOURCE_PATH)/qmake
+QMKLIBSRC = $(QMKSRC)/library
QMKGENSRC = $(QMKSRC)/generators
#qmake code
@@ -82,7 +83,7 @@ DEPEND_SRC = \
$(QTSRCS)
CPPFLAGS = -g $(OPENSOURCE_CXXFLAGS) \
- -I$(QMKSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \
+ -I$(QMKSRC) -I$(QMKLIBSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \
-I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 4cf0b37adf..b97dec863e 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -33,7 +33,7 @@ CFLAGS_EXTRA = /MP
CFLAGS_BARE = -c -Fo./ \
-W3 -nologo -O1 \
$(CFLAGS_EXTRA) \
- -I$(QMKSRC) -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
+ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \
-I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 453dca1f26..8a29494f01 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -9,6 +9,7 @@ endif
CORESRC = $(SOURCE_PATH)/src/corelib
TOOLSRC = $(SOURCE_PATH)/tools
QMKSRC = $(SOURCE_PATH)/qmake
+QMKLIBSRC = $(QMKSRC)/library
# SHELL is the full path of sh.exe, unless
# 1) it is found in the current directory
@@ -43,7 +44,7 @@ endif
#
CXX = g++
CFLAGS = -c -o$@ -O \
- -I$(QMKSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
+ -I$(QMKSRC) -I$(QMKLIBSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \
-I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp
index 3a2e4fb285..d1420b27ba 100644
--- a/qmake/generators/integrity/gbuild.cpp
+++ b/qmake/generators/integrity/gbuild.cpp
@@ -70,7 +70,7 @@ GBuildMakefileGenerator::write()
QString filename(Option::output.fileName());
QString pathtoremove(qmake_getpwd());
QString relpath(pathtoremove);
- QString strtarget(project->first("TARGET"));
+ QString strtarget(project->first("TARGET").toQString());
bool isnativebin = nativebins.contains(strtarget);
relpath.replace(Option::output_dir, "");
@@ -214,7 +214,7 @@ GBuildMakefileGenerator::write()
}
QTextStream t(&Option::output);
- QString primaryTarget(project->values("QMAKE_CXX").at(0));
+ QString primaryTarget(project->values("QMAKE_CXX").at(0).toQString());
pathtoremove += QDir::separator();
filename.remove(qmake_getpwd());
@@ -258,8 +258,8 @@ GBuildMakefileGenerator::write()
t << "\t-Iwork\n";
t << "\t-Llib\n";
t << "\t";
- const QStringList &l = project->values("QMAKE_CXXFLAGS");
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ const ProStringList &l = project->values("QMAKE_CXXFLAGS");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).startsWith("-"))
t << "\n" << "\t" << (*it);
else
@@ -284,8 +284,8 @@ GBuildMakefileGenerator::write()
if (isnativebin && (i == 0))
continue;
t << "\t";
- const QStringList &l = project->values(src[i]);
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ const ProStringList &l = project->values(src[i]);
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).startsWith("-"))
t << "\n" << "\t" << (*it);
else
@@ -297,14 +297,15 @@ GBuildMakefileGenerator::write()
/* first subdirectories/subprojects */
{
- const QStringList &l = project->values("SUBDIRS");
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- QString gpjname((*it));
+ const ProStringList &l = project->values("SUBDIRS");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ QString gpjname((*it).toQString());
/* avoid native tools */
if (nativebins.contains(gpjname.section("_", -1)))
continue;
- if (!project->first((*it) + ".subdir").isEmpty())
- gpjname = project->first((*it) + ".subdir");
+ const ProKey skey(*it + ".subdir");
+ if (!project->first(skey).isEmpty())
+ gpjname = project->first(skey).toQString();
else
gpjname.replace("_", QDir::separator());
gpjname += QDir::separator() + gpjname.section(QDir::separator(), -1);
@@ -318,9 +319,9 @@ GBuildMakefileGenerator::write()
}
{
- const QStringList &l = project->values("RESOURCES");
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- QString tmpstr(*it);
+ const ProStringList &l = project->values("RESOURCES");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ QString tmpstr((*it).toQString());
tmpstr.remove(pathtoremove);
t << tmpstr << "\t[Qt Resource]\n";
tmpstr = tmpstr.section(".", -2, -1).section(QDir::separator(), -1);
@@ -332,9 +333,9 @@ GBuildMakefileGenerator::write()
}
}
{
- const QStringList &l = project->values("FORMS");
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- QString tmpstr(*it);
+ const ProStringList &l = project->values("FORMS");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ QString tmpstr((*it).toQString());
tmpstr.remove(pathtoremove);
t << tmpstr << "\t[Qt Dialog]\n";
tmpstr = tmpstr.section(".", 0, 0).section(QDir::separator(), -1);
@@ -348,23 +349,23 @@ GBuildMakefileGenerator::write()
/* source files for this project */
static const char * const src[] = { "HEADERS", "SOURCES", 0 };
for (int i = 0; src[i]; i++) {
- const QStringList &l = project->values(src[i]);
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ const ProStringList &l = project->values(src[i]);
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).isEmpty())
continue;
/* native tools aren't preprocessed */
if (!isnativebin)
- t << writeOne((*it), pathtoremove);
+ t << writeOne((*it).toQString(), pathtoremove);
else
- t << QString(*it).remove(pathtoremove) << "\n";
+ t << (*it).toQString().remove(pathtoremove) << "\n";
}
}
t << "\n";
{
- const QStringList &l = project->values("GENERATED_SOURCES");
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- t << "work/" << (*it).section(QDir::separator(), -1) << "\n";
+ const ProStringList &l = project->values("GENERATED_SOURCES");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ t << "work/" << (*it).toQString().section(QDir::separator(), -1) << "\n";
}
}
@@ -395,7 +396,7 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove
QString tmpstr(filename.section("/", -1));
QString filepath(pathtoremove);
if (!project->values("QT_SOURCE_TREE").isEmpty()) {
- filepath.remove(project->values("QT_SOURCE_TREE").first());
+ filepath.remove(project->first("QT_SOURCE_TREE").toQString());
filepath.remove(0, 1);
}
s += "\n\t:preexecShellSafe='${QT_BUILD_DIR}/bin/moc ";
diff --git a/qmake/generators/integrity/gbuild.h b/qmake/generators/integrity/gbuild.h
index 8c09fb3e7f..49ea0fa960 100644
--- a/qmake/generators/integrity/gbuild.h
+++ b/qmake/generators/integrity/gbuild.h
@@ -62,7 +62,7 @@ public:
protected:
bool doPrecompiledHeaders() const { return false; }
virtual bool doDepends() const { return true; }
- QStringList nativebins;
+ ProStringList nativebins;
};
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index ba7d356320..04775cd63c 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -134,16 +134,21 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
QList<ProjectBuilderSubDirs*> pb_subdirs;
pb_subdirs.append(new ProjectBuilderSubDirs(project, QString(), false));
QString oldpwd = qmake_getpwd();
- QMap<QString, QStringList> groups;
+ QMap<QString, ProStringList> groups;
for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) {
ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir];
- const QStringList subdirs = pb->project->values("SUBDIRS");
+ const ProStringList &subdirs = pb->project->values("SUBDIRS");
for(int subdir = 0; subdir < subdirs.count(); subdir++) {
- QString tmp = subdirs[subdir];
- if(!pb->project->isEmpty(tmp + ".file"))
- tmp = pb->project->first(tmp + ".file");
- else if(!pb->project->isEmpty(tmp + ".subdir"))
- tmp = pb->project->first(tmp + ".subdir");
+ ProString tmpk = subdirs[subdir];
+ const ProKey fkey(tmpk + ".file");
+ if (!pb->project->isEmpty(fkey)) {
+ tmpk = pb->project->first(fkey);
+ } else {
+ const ProKey skey(tmpk + ".subdir");
+ if (!pb->project->isEmpty(skey))
+ tmpk = pb->project->first(skey);
+ }
+ QString tmp = tmpk.toQString();
if(fileInfo(tmp).isRelative() && !pb->subdir.isEmpty()) {
QString subdir = pb->subdir;
if(!subdir.endsWith(Option::dir_sep))
@@ -242,7 +247,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
<< "\t\t" << "};" << "\n";
//PRODUCTGROUP
t << "\t\t" << keyFor(pbxproj + "_PRODUCTGROUP") << " = {" << "\n"
- << "\t\t\t" << writeSettings("children", project->values(pbxproj + "_WRAPPER"), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("children", project->values(ProKey(pbxproj + "_WRAPPER")), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", "Products") << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
@@ -279,7 +284,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
qDeleteAll(pb_subdirs);
pb_subdirs.clear();
- for(QMap<QString, QStringList>::Iterator grp_it = groups.begin(); grp_it != groups.end(); ++grp_it) {
+ for (QMap<QString, ProStringList>::Iterator grp_it = groups.begin(); grp_it != groups.end(); ++grp_it) {
t << "\t\t" << keyFor(grp_it.key()) << " = {" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";" << "\n"
@@ -298,15 +303,16 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
if(as_release)
settings.insert("GCC_GENERATE_DEBUGGING_SYMBOLS", "NO");
if(project->isActiveConfig("sdk") && !project->isEmpty("QMAKE_MAC_SDK"))
- settings.insert("SDKROOT", project->first("QMAKE_MAC_SDK"));
+ settings.insert("SDKROOT", project->first("QMAKE_MAC_SDK").toQString());
{
- const QStringList &l = project->values("QMAKE_MAC_XCODE_SETTINGS");
+ const ProStringList &l = project->values("QMAKE_MAC_XCODE_SETTINGS");
for(int i = 0; i < l.size(); ++i) {
- QString name = l.at(i);
- const QString value = project->values(name + QLatin1String(".value")).join(QString(Option::field_sep));
- if(!project->isEmpty(name + QLatin1String(".name")))
- name = project->values(name + QLatin1String(".name")).first();
- settings.insert(name, value);
+ ProString name = l.at(i);
+ const ProKey nkey(name + ".name");
+ if (!project->isEmpty(nkey))
+ name = project->first(nkey);
+ const QString value = project->values(ProKey(name + ".value")).join(QString(Option::field_sep));
+ settings.insert(name.toQString(), value);
}
}
@@ -327,7 +333,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
if (project->isActiveConfig("debug") != (bool)as_release)
active_buildstyle = name;
t << "\t\t" << key << " = {" << "\n"
- << "\t\t\t" << writeSettings("buildRules", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("buildRules", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << "buildSettings = {" << "\n";
for(QMap<QString, QString>::Iterator set_it = settings.begin(); set_it != settings.end(); ++set_it)
t << "\t\t\t\t" << writeSettings(set_it.key(), set_it.value()) << ";\n";
@@ -346,13 +352,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
#ifdef GENERATE_AGGREGRATE_SUBDIR
//target
t << "\t\t" << keyFor("QMAKE_SUBDIR_PBX_AGGREGATE_TARGET") << " = {" << "\n"
- << "\t\t\t" << writeSettings("buildPhases", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("buildPhases", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << "buildSettings = {" << "\n"
<< "\t\t\t\t" << writeSettings("PRODUCT_NAME", project->values("TARGET").first()) << ";" << "\n"
<< "\t\t\t" << "};" << "\n";
{
- QStringList dependencies;
- const QStringList &qmake_subdirs = project->values("QMAKE_PBX_SUBDIRS");
+ ProStringList dependencies;
+ const ProStringList &qmake_subdirs = project->values("QMAKE_PBX_SUBDIRS");
for(int i = 0; i < qmake_subdirs.count(); i++)
dependencies += keyFor(qmake_subdirs[i] + "_TARGETREF");
t << "\t\t\t" << writeSettings("dependencies", dependencies, SettingsAsList, 4) << ";" << "\n"
@@ -379,13 +385,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
<< "\t\t\t" << writeSettings("buildStyles", project->values("QMAKE_SUBDIR_PBX_BUILDSTYLES"), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXProject", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("mainGroup", keyFor("QMAKE_SUBDIR_PBX_ROOT_GROUP")) << ";" << "\n"
- << "\t\t\t" << writeSettings("projectDirPath", QStringList()) << ";" << "\n";
+ << "\t\t\t" << writeSettings("projectDirPath", ProStringList()) << ";" << "\n";
t << "\t\t\t" << writeSettings("buildConfigurationList", keyFor("QMAKE_SUBDIR_PBX_BUILDCONFIG_LIST")) << ";" << "\n";
t << "\t\t\t" << "projectReferences = (" << "\n";
{
- const QStringList &qmake_subdirs = project->values("QMAKE_PBX_SUBDIRS");
+ const ProStringList &qmake_subdirs = project->values("QMAKE_PBX_SUBDIRS");
for(int i = 0; i < qmake_subdirs.count(); i++) {
- QString subdir = qmake_subdirs[i];
+ const ProString &subdir = qmake_subdirs[i];
t << "\t\t\t\t" << "{" << "\n"
<< "\t\t\t\t\t" << writeSettings("ProductGroup", keyFor(subdir + "_PRODUCTGROUP")) << ";" << "\n"
<< "\t\t\t\t\t" << writeSettings("ProjectRef", keyFor(subdir + "_PROJECTREF")) << ";" << "\n"
@@ -397,7 +403,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
#ifdef GENERATE_AGGREGRATE_SUBDIR
project->values("QMAKE_SUBDIR_AGGREGATE_TARGET"),
#else
- QStringList(),
+ ProStringList(),
#endif
SettingsAsList, 4) << ";" << "\n"
<< "\t\t" << "};" << "\n";
@@ -459,7 +465,7 @@ ProjectBuilderSources::ProjectBuilderSources(const QString &k, bool b,
QStringList
ProjectBuilderSources::files(QMakeProject *project) const
{
- QStringList ret = project->values(key);
+ QStringList ret = project->values(ProKey(key)).toQStringList();
if(key == "QMAKE_INTERNAL_INCLUDED_FILES") {
ret.prepend(project->projectFile());
for(int i = 0; i < ret.size(); ++i) {
@@ -470,7 +476,7 @@ ProjectBuilderSources::files(QMakeProject *project) const
}
}
if(key == "SOURCES" && project->first("TEMPLATE") == "app" && !project->isEmpty("ICON"))
- ret.append(project->first("ICON"));
+ ret.append(project->first("ICON").toQString());
return ret;
}
@@ -478,12 +484,12 @@ ProjectBuilderSources::files(QMakeProject *project) const
bool
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
{
- QStringList tmp;
+ ProStringList tmp;
bool did_preprocess = false;
//HEADER
const int pbVersion = pbuilderVersion();
- QStringList buildConfigGroups;
+ ProStringList buildConfigGroups;
buildConfigGroups << "PROJECT" << "TARGET";
t << "// !$*UTF8*$!" << "\n"
@@ -513,18 +519,18 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {" << "\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";" << "\n"
- << "\t\t\t" << writeSettings("files", QStringList(), SettingsAsList, 4) << ";" << "\n"
- << "\t\t\t" << writeSettings("generatedFileNames", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("generatedFileNames", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", "Qt Qmake") << ";" << "\n"
- << "\t\t\t" << writeSettings("neededFileNames", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("neededFileNames", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";" << "\n"
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f '" + escapeFilePath(mkfile) + "'")) << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
//DUMP SOURCES
- QMap<QString, QStringList> groups;
+ QMap<QString, ProStringList> groups;
QList<ProjectBuilderSources> sources;
sources.append(ProjectBuilderSources("SOURCES", true));
sources.append(ProjectBuilderSources("GENERATED_SOURCES", true));
@@ -532,16 +538,17 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
sources.append(ProjectBuilderSources("HEADERS"));
sources.append(ProjectBuilderSources("QMAKE_INTERNAL_INCLUDED_FILES"));
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- if(project->isEmpty((*it) + ".output"))
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ if (project->isEmpty(ProKey(*it + ".output")))
continue;
- QString name = (*it);
- if(!project->isEmpty((*it) + ".name"))
- name = project->first((*it) + ".name");
- const QStringList &inputs = project->values((*it) + ".input");
+ ProString name = *it;
+ const ProKey nkey(*it + ".name");
+ if (!project->isEmpty(nkey))
+ name = project->first(nkey);
+ const ProStringList &inputs = project->values(ProKey(*it + ".input"));
for(int input = 0; input < inputs.size(); ++input) {
- if(project->isEmpty(inputs.at(input)))
+ if (project->isEmpty(inputs.at(input).toKey()))
continue;
bool duplicate = false;
for(int i = 0; i < sources.size(); ++i) {
@@ -551,25 +558,25 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
if(!duplicate) {
- bool isObj = project->values((*it) + ".CONFIG").indexOf("no_link") == -1;
- const QStringList &outputs = project->values((*it) + ".variable_out");
+ bool isObj = project->values(ProKey(*it + ".CONFIG")).indexOf("no_link") == -1;
+ const ProStringList &outputs = project->values(ProKey(*it + ".variable_out"));
for(int output = 0; output < outputs.size(); ++output) {
if(outputs.at(output) != "OBJECT") {
isObj = false;
break;
}
}
- sources.append(ProjectBuilderSources(inputs.at(input), true,
- QString("Sources [") + name + "]", (*it), isObj));
+ sources.append(ProjectBuilderSources(inputs.at(input).toQString(), true,
+ QString("Sources [") + name + "]", (*it).toQString(), isObj));
}
}
}
}
for(int source = 0; source < sources.size(); ++source) {
- QStringList &src_list = project->values("QMAKE_PBX_" + sources.at(source).keyName());
- QStringList &root_group_list = project->values("QMAKE_PBX_GROUPS");
+ ProStringList &src_list = project->values(ProKey("QMAKE_PBX_" + sources.at(source).keyName()));
+ ProStringList &root_group_list = project->values("QMAKE_PBX_GROUPS");
- QStringList files = fileFixify(sources.at(source).files(project));
+ const QStringList &files = fileFixify(sources.at(source).files(project));
for(int f = 0; f < files.count(); ++f) {
QString file = files[f];
if(file.length() >= 2 && (file[0] == '"' || file[0] == '\'') && file[(int) file.length()-1] == file[0])
@@ -634,7 +641,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("fileRef", src_key) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXBuildFile", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << "settings = {" << "\n"
- << "\t\t\t\t" << writeSettings("ATTRIBUTES", QStringList(), SettingsAsList, 5) << ";" << "\n"
+ << "\t\t\t\t" << writeSettings("ATTRIBUTES", ProStringList(), SettingsAsList, 5) << ";" << "\n"
<< "\t\t\t" << "};" << "\n"
<< "\t\t" << "};" << "\n";
if(sources.at(source).isObjectOutput(file))
@@ -646,14 +653,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(root_group_list.indexOf(group_key) == -1)
root_group_list += group_key;
- QStringList &group = groups[sources.at(source).groupName()];
+ ProStringList &group = groups[sources.at(source).groupName()];
for(int src = 0; src < src_list.size(); ++src) {
if(group.indexOf(src_list.at(src)) == -1)
group += src_list.at(src);
}
}
}
- for(QMap<QString, QStringList>::Iterator grp_it = groups.begin(); grp_it != groups.end(); ++grp_it) {
+ for (QMap<QString, ProStringList>::Iterator grp_it = groups.begin(); grp_it != groups.end(); ++grp_it) {
t << "\t\t" << keyFor(grp_it.key()) << " = {" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("children", grp_it.value(), SettingsAsList, 4) << ";" << "\n"
@@ -689,8 +696,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
mkt << " -I" << pwd;
}
{
- const QStringList &incs = project->values("INCLUDEPATH");
- for(QStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit)
+ const ProStringList &incs = project->values("INCLUDEPATH");
+ for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit)
mkt << " " << "-I" << escapeFilePath((*incit));
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
@@ -701,17 +708,17 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
mkt << "IMAGES = " << varList("QMAKE_IMAGE_COLLECTION") << endl;
mkt << "PARSERS =";
if(!project->isEmpty("YACCSOURCES")) {
- const QStringList &yaccs = project->values("YACCSOURCES");
- for (QStringList::ConstIterator yit = yaccs.begin(); yit != yaccs.end(); ++yit) {
- QFileInfo fi(fileInfo((*yit)));
+ const ProStringList &yaccs = project->values("YACCSOURCES");
+ for (ProStringList::ConstIterator yit = yaccs.begin(); yit != yaccs.end(); ++yit) {
+ QFileInfo fi(fileInfo((*yit).toQString()));
mkt << " " << fi.path() << Option::dir_sep << fi.baseName()
<< Option::yacc_mod << Option::cpp_ext.first();
}
}
if(!project->isEmpty("LEXSOURCES")) {
- const QStringList &lexs = project->values("LEXSOURCES");
- for (QStringList::ConstIterator lit = lexs.begin(); lit != lexs.end(); ++lit) {
- QFileInfo fi(fileInfo((*lit)));
+ const ProStringList &lexs = project->values("LEXSOURCES");
+ for (ProStringList::ConstIterator lit = lexs.begin(); lit != lexs.end(); ++lit) {
+ QFileInfo fi(fileInfo((*lit).toQString()));
mkt << " " << fi.path() << Option::dir_sep << fi.baseName()
<< Option::lex_mod << Option::cpp_ext.first();
}
@@ -725,24 +732,25 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
writeExtraTargets(mkt);
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
mkt << "compilers:";
- const QStringList &compilers = project->values("QMAKE_EXTRA_COMPILERS");
+ const ProStringList &compilers = project->values("QMAKE_EXTRA_COMPILERS");
for(int compiler = 0; compiler < compilers.size(); ++compiler) {
- QString tmp_out = project->first(compilers.at(compiler) + ".output");
- if(project->isEmpty(compilers.at(compiler) + ".output"))
+ const ProStringList &tmp_out = project->values(ProKey(compilers.at(compiler) + ".output"));
+ if (tmp_out.isEmpty())
continue;
- const QStringList &inputs = project->values(compilers.at(compiler) + ".input");
+ const ProStringList &inputs = project->values(ProKey(compilers.at(compiler) + ".input"));
for(int input = 0; input < inputs.size(); ++input) {
- if(project->isEmpty(inputs.at(input)))
+ const ProStringList &files = project->values(inputs.at(input).toKey());
+ if (files.isEmpty())
continue;
- const QStringList &files = project->values(inputs.at(input));
for(int file = 0, added = 0; file < files.size(); ++file) {
- if(!verifyExtraCompiler(compilers.at(compiler), files.at(file)))
+ QString fn = files.at(file).toQString();
+ if (!verifyExtraCompiler(compilers.at(compiler), fn))
continue;
if(added && !(added % 3))
mkt << "\\\n\t";
++added;
- const QString file_name = fileFixify(files.at(file), Option::output_dir, Option::output_dir);
- mkt << " " << replaceExtraCompilerVariables(tmp_out, file_name, QString());
+ const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir);
+ mkt << " " << replaceExtraCompilerVariables(tmp_out.first().toQString(), file_name, QString());
}
}
}
@@ -759,7 +767,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {" << "\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";" << "\n"
- << "\t\t\t" << writeSettings("files", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("generatedFileNames", fixListForOutput("QMAKE_PBX_OBJ"), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", "Qt Preprocessors") << ";" << "\n"
@@ -782,27 +790,28 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES
- QStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"),
+ ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"),
&frameworkdirs = project->values("QMAKE_FRAMEWORKPATH");
static const char * const libs[] = { "QMAKE_LFLAGS", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; libs[i]; i++) {
tmp = project->values(libs[i]);
for(int x = 0; x < tmp.count();) {
bool remove = false;
- QString library, name, opt = tmp[x].trimmed();
+ QString library, name;
+ ProString opt = tmp[x].trimmed();
if (opt.length() >= 2 && (opt.at(0) == '"' || opt.at(0) == '\'') && opt.endsWith(opt.at(0)))
opt = opt.mid(1, opt.length()-2);
if(opt.startsWith("-L")) {
- QString r = opt.right(opt.length() - 2);
+ QString r = opt.mid(2).toQString();
fixForOutput(r);
libdirs.append(r);
} else if(opt == "-prebind") {
project->values("QMAKE_DO_PREBINDING").append("TRUE");
remove = true;
} else if(opt.startsWith("-l")) {
- name = opt.right(opt.length() - 2);
+ name = opt.mid(2).toQString();
QString lib("lib" + name);
- for(QStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) {
+ for (ProStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) {
if(project->isActiveConfig("link_prl")) {
/* This isn't real nice, but it is real useful. This looks in a prl
for what the library will ultimately be called so we can stick it
@@ -840,11 +849,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} else if(opt.startsWith("-F")) {
QString r;
if(opt.size() > 2) {
- r = opt.right(opt.length() - 2);
+ r = opt.mid(2).toQString();
} else {
if(x == tmp.count()-1)
break;
- r = tmp[++x];
+ r = tmp[++x].toQString();
}
if(!r.isEmpty()) {
fixForOutput(r);
@@ -853,8 +862,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} else if(opt == "-framework") {
if(x == tmp.count()-1)
break;
- const QString framework = tmp[x+1];
- QStringList fdirs = frameworkdirs;
+ const ProString &framework = tmp[x+1];
+ ProStringList fdirs = frameworkdirs;
fdirs << "/System/Library/Frameworks/" << "/Library/Frameworks/";
for(int fdir = 0; fdir < fdirs.count(); fdir++) {
if(exists(fdirs[fdir] + QDir::separator() + framework + ".framework")) {
@@ -865,9 +874,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
} else if (!opt.startsWith('-')) {
- if(exists(opt)) {
+ QString fn = opt.toQString();
+ if (exists(fn)) {
remove = true;
- library = opt;
+ library = fn;
}
}
if(!library.isEmpty()) {
@@ -926,7 +936,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++)
t << "tmp/lib" << tmp[i] << ".a" << ":\n\t"
- << var(QString("MAKELIB") + tmp[i]) << endl << endl;
+ << var(ProKey("MAKELIB" + tmp[i])) << endl << endl;
mkt.flush();
mkf.close();
writingUnixMakefileGenerator = false;
@@ -936,11 +946,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {" << "\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";" << "\n"
- << "\t\t\t" << writeSettings("files", QStringList(), SettingsAsList, 4) << ";" << "\n"
- << "\t\t\t" << writeSettings("generatedFileNames", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("generatedFileNames", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", "Qt Sublibs") << ";" << "\n"
- << "\t\t\t" << writeSettings("neededFileNames", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("neededFileNames", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << "\n"
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f '" + escapeFilePath(mkfile) + "'")) << ";" << "\n"
<< "\t\t" << "};" << "\n";
@@ -955,7 +965,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_LIBRARIES"), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";" << "\n"
- << "\t\t\t" << writeSettings("path", QStringList()) << ";" << "\n"
+ << "\t\t\t" << writeSettings("path", ProStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
@@ -977,7 +987,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << "files = (" << "\n";
if(!project->isEmpty("ICON")) {
- QString icon = project->first("ICON");
+ ProString icon = project->first("ICON");
if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0)))
icon = icon.mid(1, icon.length()-2);
t << "\t\t\t\t" << keyFor(icon + ".BUILDABLE") << ",\n";
@@ -989,7 +999,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
if (!project->isEmpty("DESTDIR")) {
QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE");
- QString destDir = project->first("DESTDIR");
+ QString destDir = project->first("DESTDIR").toQString();
destDir = fixForOutput(destDir);
destDir = fileInfo(Option::fixPathToLocalOS(destDir)).absoluteFilePath();
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
@@ -997,9 +1007,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", "Project Copy") << ";" << "\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";" << "\n"
- << "\t\t\t" << writeSettings("files", QStringList(), SettingsAsList, 4) << ";" << "\n"
- << "\t\t\t" << writeSettings("inputPaths", QStringList(), SettingsAsList, 4) << ";" << "\n"
- << "\t\t\t" << writeSettings("outputPaths", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("inputPaths", ProStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("outputPaths", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";" << "\n"
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + escapeFilePath(destDir))) << ";" << "\n"
@@ -1007,22 +1017,23 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
//BUNDLE_DATA BUILDPHASE (copy)
if(!project->isEmpty("QMAKE_BUNDLE_DATA")) {
- QStringList bundle_file_refs;
+ ProStringList bundle_file_refs;
//all bundle data
- const QStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
+ const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
for(int i = 0; i < bundle_data.count(); i++) {
- QStringList pbx_files;
+ ProStringList pbx_files;
//all files
- const QStringList &files = project->values(bundle_data[i] + ".files");
+ const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
for(int file = 0; file < files.count(); file++) {
- QString file_ref_key = keyFor("QMAKE_PBX_BUNDLE_COPY_FILE_REF." + bundle_data[i] + "-" + files[file]);
+ QString fn = files[file].toQString();
+ QString file_ref_key = keyFor("QMAKE_PBX_BUNDLE_COPY_FILE_REF." + bundle_data[i] + "-" + fn);
bundle_file_refs += file_ref_key;
t << "\t\t" << file_ref_key << " = {" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";" << "\n"
- << "\t\t\t" << writeSettings("path", escapeFilePath(files[file])) << ";" << "\n"
- << "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(files[file])), SettingsNoQuote) << ";" << "\n"
+ << "\t\t\t" << writeSettings("path", escapeFilePath(fn)) << ";" << "\n"
+ << "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(fn)), SettingsNoQuote) << ";" << "\n"
<< "\t\t" << "};" << "\n";
- QString copy_file_key = keyFor("QMAKE_PBX_BUNDLE_COPY_FILE." + bundle_data[i] + "-" + files[file]);
+ QString copy_file_key = keyFor("QMAKE_PBX_BUNDLE_COPY_FILE." + bundle_data[i] + "-" + fn);
pbx_files += copy_file_key;
t << "\t\t" << copy_file_key << " = {\n"
<< "\t\t\t" << writeSettings("fileRef", file_ref_key) << ";" << "\n"
@@ -1034,10 +1045,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
//the phase
QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]);
QString path;
- if(!project->isEmpty(bundle_data[i] + ".version")) {
+ if (!project->isEmpty(ProKey(bundle_data[i] + ".version"))) {
//###
}
- path += project->first(bundle_data[i] + ".path");
+ path += project->first(ProKey(bundle_data[i] + ".path"));
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("name", "Bundle Copy [" + bundle_data[i] + "]") << ";" << "\n"
@@ -1055,7 +1066,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("children", bundle_file_refs, SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", "Source [bundle data]") << ";" << "\n"
- << "\t\t\t" << writeSettings("path", QStringList()) << ";" << "\n"
+ << "\t\t\t" << writeSettings("path", ProStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
@@ -1066,7 +1077,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("children", project->values("QMAKE_PBX_GROUPS"), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXGroup", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";" << "\n"
- << "\t\t\t" << writeSettings("path", QStringList()) << ";" << "\n"
+ << "\t\t\t" << writeSettings("path", ProStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("refType", "4", SettingsNoQuote) << ";" << "\n"
<< "\t\t" << "};" << "\n";
//REFERENCE
@@ -1074,7 +1085,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t" << keyFor(pbx_dir + "QMAKE_PBX_REFERENCE") << " = {" << "\n"
<< "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";" << "\n";
if(project->first("TEMPLATE") == "app") {
- QString targ = project->first("QMAKE_ORIG_TARGET");
+ ProString targ = project->first("QMAKE_ORIG_TARGET");
if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) {
if(!project->isEmpty("QMAKE_BUNDLE_NAME"))
targ = project->first("QMAKE_BUNDLE_NAME");
@@ -1093,7 +1104,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
qmake_getpwd()) + Option::dir_sep + targ;
t << "\t\t\t" << writeSettings("path", escapeFilePath(targ)) << ";" << "\n";
} else {
- QString lib = project->first("QMAKE_ORIG_TARGET");
+ ProString lib = project->first("QMAKE_ORIG_TARGET");
if(project->isActiveConfig("staticlib")) {
lib = project->first("TARGET");
} else if(!project->isActiveConfig("lib_bundle")) {
@@ -1141,7 +1152,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES") + project->values("QMAKE_PBX_BUILDPHASES"),
SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << "buildSettings = {" << "\n";
- QString cCompiler = project->first("QMAKE_CC");
+ ProString cCompiler = project->first("QMAKE_CC");
if (!cCompiler.isEmpty()) {
t << "\t\t\t\t" << writeSettings("CC", fixForOutput(findProgram(cCompiler))) << ";" << "\n";
}
@@ -1152,10 +1163,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("LEXFLAGS", fixListForOutput("QMAKE_LEXFLAGS")) << ";" << "\n"
<< "\t\t\t\t" << writeSettings("YACCFLAGS", fixListForOutput("QMAKE_YACCFLAGS")) << ";" << "\n"
- << "\t\t\t\t" << writeSettings("OTHER_REZFLAGS", QStringList()) << ";" << "\n"
- << "\t\t\t\t" << writeSettings("SECTORDER_FLAGS", QStringList()) << ";" << "\n"
- << "\t\t\t\t" << writeSettings("WARNING_CFLAGS", QStringList()) << ";" << "\n"
- << "\t\t\t\t" << writeSettings("PREBINDING", QStringList((project->isEmpty("QMAKE_DO_PREBINDING") ? "NO" : "YES")), SettingsNoQuote) << ";" << "\n";
+ << "\t\t\t\t" << writeSettings("OTHER_REZFLAGS", ProStringList()) << ";" << "\n"
+ << "\t\t\t\t" << writeSettings("SECTORDER_FLAGS", ProStringList()) << ";" << "\n"
+ << "\t\t\t\t" << writeSettings("WARNING_CFLAGS", ProStringList()) << ";" << "\n"
+ << "\t\t\t\t" << writeSettings("PREBINDING", ProStringList((project->isEmpty("QMAKE_DO_PREBINDING") ? "NO" : "YES")), SettingsNoQuote) << ";" << "\n";
if(!project->isEmpty("PRECOMPILED_HEADER")) {
t << "\t\t\t\t" << writeSettings("GCC_PRECOMPILE_PREFIX_HEADER", "YES") << ";" << "\n"
<< "\t\t\t\t" << writeSettings("GCC_PREFIX_HEADER", escapeFilePath(project->first("PRECOMPILED_HEADER"))) << ";" << "\n";
@@ -1163,7 +1174,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if((project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) ||
(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
project->isActiveConfig("lib_bundle"))) {
- QString plist = fileFixify(project->first("QMAKE_INFO_PLIST"));
+ QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString());
if(plist.isEmpty())
plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
if(exists(plist)) {
@@ -1172,11 +1183,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QTextStream plist_in(&plist_in_file);
QString plist_in_text = plist_in.readAll();
plist_in_text = plist_in_text.replace("@ICON@",
- (project->isEmpty("ICON") ? QString("") : project->first("ICON").section(Option::dir_sep, -1)));
+ (project->isEmpty("ICON") ? QString("") : project->first("ICON").toQString().section(Option::dir_sep, -1)));
if(project->first("TEMPLATE") == "app") {
- plist_in_text = plist_in_text.replace("@EXECUTABLE@", project->first("QMAKE_ORIG_TARGET"));
+ plist_in_text = plist_in_text.replace("@EXECUTABLE@", project->first("QMAKE_ORIG_TARGET").toQString());
} else {
- plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET"));
+ plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET").toQString());
}
if (!project->values("VERSION").isEmpty()) {
plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." +
@@ -1184,7 +1195,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
plist_in_text = plist_in_text.replace("@TYPEINFO@",
(project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") :
- project->first("QMAKE_PKGINFO_TYPEINFO").left(4)));
+ project->first("QMAKE_PKGINFO_TYPEINFO").left(4).toQString()));
QFile plist_out_file("Info.plist");
if(plist_out_file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream plist_out(&plist_out_file);
@@ -1206,13 +1217,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
SettingsAsList, 6) << ";" << "\n";
}
if(!project->isEmpty("DESTDIR")) {
- QString dir = project->first("DESTDIR");
- if (QDir::isRelativePath(dir))
+ ProString dir = project->first("DESTDIR");
+ if (QDir::isRelativePath(dir.toQString()))
dir.prepend(qmake_getpwd() + Option::dir_sep);
t << "\t\t\t\t" << writeSettings("INSTALL_DIR", dir) << ";" << "\n";
}
if (project->first("TEMPLATE") == "lib") {
- t << "\t\t\t\t" << writeSettings("INSTALL_PATH", QStringList()) << ";" << "\n";
+ t << "\t\t\t\t" << writeSettings("INSTALL_PATH", ProStringList()) << ";" << "\n";
}
if(!project->isEmpty("VERSION") && project->first("VERSION") != "0.0.0") {
t << "\t\t\t\t" << writeSettings("DYLIB_CURRENT_VERSION", project->first("VER_MAJ")+"."+project->first("VER_MIN")+"."+project->first("VER_PAT")) << ";" << "\n";
@@ -1227,23 +1238,23 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_MACOSX_DEPLOYMENT_TARGET"))
t << "\t\t\t\t" << writeSettings("MACOSX_DEPLOYMENT_TARGET", project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET")) << ";" << "\n";
if (!project->isEmpty("OBJECTS_DIR"))
- t << "\t\t\t\t" << writeSettings("OBJROOT", fixForOutput(project->first("OBJECTS_DIR"))) << ";" << "\n";
+ t << "\t\t\t\t" << writeSettings("OBJROOT", fixForOutput(project->first("OBJECTS_DIR").toQString())) << ";" << "\n";
if(project->first("TEMPLATE") == "app") {
- t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET"))) << ";" << "\n";
+ t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString())) << ";" << "\n";
} else {
if(!project->isActiveConfig("plugin") && project->isActiveConfig("staticlib")) {
t << "\t\t\t\t" << writeSettings("LIBRARY_STYLE", "STATIC") << ";" << "\n";
} else {
t << "\t\t\t\t" << writeSettings("LIBRARY_STYLE", "DYNAMIC") << ";" << "\n";
}
- QString lib = project->first("QMAKE_ORIG_TARGET");
+ ProString lib = project->first("QMAKE_ORIG_TARGET");
if(!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
lib.prepend("lib");
t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", escapeFilePath(lib)) << ";" << "\n";
}
tmp = project->values("QMAKE_PBX_VARS");
for(int i = 0; i < tmp.count(); i++) {
- QString var = tmp[i], val = QString::fromLocal8Bit(qgetenv(var.toLatin1().constData()));
+ QString var = tmp[i].toQString(), val = QString::fromLocal8Bit(qgetenv(var.toLatin1().constData()));
if(val.isEmpty() && var == "TB")
val = "/usr/bin/";
t << "\t\t\t\t" << writeSettings(var, escapeFilePath(val)) << ";" << "\n";
@@ -1311,7 +1322,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t" << writeSettings("name", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";" << "\n"
<< "\t\t\t" << writeSettings("productName", escapeFilePath(project->first("QMAKE_ORIG_TARGET"))) << ";" << "\n";
} else {
- QString lib = project->first("QMAKE_ORIG_TARGET");
+ ProString lib = project->first("QMAKE_ORIG_TARGET");
if(!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
lib.prepend("lib");
t << "\t\t\t" << writeSettings("name", escapeFilePath(lib)) << ";" << "\n"
@@ -1339,56 +1350,57 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(!as_release)
settings.insert("GCC_OPTIMIZATION_LEVEL", "0");
if(project->isActiveConfig("sdk") && !project->isEmpty("QMAKE_MAC_SDK"))
- settings.insert("SDKROOT", project->first("QMAKE_MAC_SDK"));
+ settings.insert("SDKROOT", project->first("QMAKE_MAC_SDK").toQString());
{
- const QStringList &l = project->values("QMAKE_MAC_XCODE_SETTINGS");
+ const ProStringList &l = project->values("QMAKE_MAC_XCODE_SETTINGS");
for(int i = 0; i < l.size(); ++i) {
- QString name = l.at(i);
- const QString value = project->values(name + QLatin1String(".value")).join(QString(Option::field_sep));
- if(!project->isEmpty(name + QLatin1String(".name")))
- name = project->values(name + QLatin1String(".name")).first();
- settings.insert(name, value);
+ ProString name = l.at(i);
+ const QString value = project->values(ProKey(name + ".value")).join(QString(Option::field_sep));
+ const ProKey nkey(name + ".name");
+ if (!project->isEmpty(nkey))
+ name = project->values(nkey).first();
+ settings.insert(name.toQString(), value);
}
}
if (project->first("TEMPLATE") == "app") {
- settings.insert("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET")));
+ settings.insert("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString()));
} else {
- QString lib = project->first("QMAKE_ORIG_TARGET");
+ ProString lib = project->first("QMAKE_ORIG_TARGET");
if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
lib.prepend("lib");
- settings.insert("PRODUCT_NAME", escapeFilePath(lib));
+ settings.insert("PRODUCT_NAME", escapeFilePath(lib.toQString()));
}
QString name = (as_release ? "Release" : "Debug");
for (int i = 0; i < buildConfigGroups.size(); i++) {
QString key = keyFor("QMAKE_PBX_BUILDCONFIG_" + name + buildConfigGroups.at(i));
- project->values("QMAKE_PBX_BUILDCONFIGS_" + buildConfigGroups.at(i)).append(key);
+ project->values(ProKey("QMAKE_PBX_BUILDCONFIGS_" + buildConfigGroups.at(i))).append(key);
t << "\t\t" << key << " = {" << "\n"
<< "\t\t\t" << writeSettings("isa", "XCBuildConfiguration", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << "buildSettings = {" << "\n";
for (QMap<QString, QString>::Iterator set_it = settings.begin(); set_it != settings.end(); ++set_it)
t << "\t\t\t\t" << writeSettings(set_it.key(), set_it.value()) << ";\n";
if (buildConfigGroups.at(i) == QLatin1String("PROJECT")) {
- t << "\t\t\t\t" << writeSettings("HEADER_SEARCH_PATHS", fixListForOutput("INCLUDEPATH") + QStringList(fixForOutput(specdir())), SettingsAsList, 5) << ";" << "\n"
+ t << "\t\t\t\t" << writeSettings("HEADER_SEARCH_PATHS", fixListForOutput("INCLUDEPATH") + ProStringList(fixForOutput(specdir())), SettingsAsList, 5) << ";" << "\n"
<< "\t\t\t\t" << writeSettings("LIBRARY_SEARCH_PATHS", fixListForOutput("QMAKE_PBX_LIBPATHS"), SettingsAsList, 5) << ";" << "\n"
<< "\t\t\t\t" << writeSettings("FRAMEWORK_SEARCH_PATHS", fixListForOutput("QMAKE_FRAMEWORKPATH"), SettingsAsList, 5) << ";" << "\n"
<< "\t\t\t\t" << writeSettings("INFOPLIST_FILE", "Info.plist") << ";" << "\n";
{
- QStringList cflags = fixListForOutput("QMAKE_CFLAGS");
- const QStringList &prl_defines = project->values("PRL_EXPORT_DEFINES");
+ ProStringList cflags = fixListForOutput("QMAKE_CFLAGS");
+ const ProStringList &prl_defines = project->values("PRL_EXPORT_DEFINES");
for (int i = 0; i < prl_defines.size(); ++i)
cflags += "-D" + prl_defines.at(i);
- const QStringList &defines = project->values("DEFINES");
+ const ProStringList &defines = project->values("DEFINES");
for (int i = 0; i < defines.size(); ++i)
cflags += "-D" + defines.at(i);
t << "\t\t\t\t" << writeSettings("OTHER_CFLAGS", cflags, SettingsAsList, 5) << ";" << "\n";
}
{
- QStringList cxxflags = fixListForOutput("QMAKE_CXXFLAGS");
- const QStringList &prl_defines = project->values("PRL_EXPORT_DEFINES");
+ ProStringList cxxflags = fixListForOutput("QMAKE_CXXFLAGS");
+ const ProStringList &prl_defines = project->values("PRL_EXPORT_DEFINES");
for (int i = 0; i < prl_defines.size(); ++i)
cxxflags += "-D" + prl_defines.at(i);
- const QStringList &defines = project->values("DEFINES");
+ const ProStringList &defines = project->values("DEFINES");
for (int i = 0; i < defines.size(); ++i)
cxxflags += "-D" + defines.at(i);
t << "\t\t\t\t" << writeSettings("OTHER_CPLUSPLUSFLAGS", cxxflags, SettingsAsList, 5) << ";" << "\n";
@@ -1402,7 +1414,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
SettingsAsList, 6) << ";" << "\n";
}
{
- QStringList archs;
+ ProStringList archs;
if (project->isActiveConfig("x86"))
archs += "i386";
if (project->isActiveConfig("ppc")) {
@@ -1425,13 +1437,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
} else {
if (project->first("TEMPLATE") == "app") {
- t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET"))) << ";" << "\n";
+ t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString())) << ";" << "\n";
} else {
if (!project->isActiveConfig("plugin") && project->isActiveConfig("staticlib"))
t << "\t\t\t\t" << writeSettings("LIBRARY_STYLE", "STATIC") << ";" << "\n";
else
t << "\t\t\t\t" << writeSettings("LIBRARY_STYLE", "DYNAMIC") << ";" << "\n";
- QString lib = project->first("QMAKE_ORIG_TARGET");
+ ProString lib = project->first("QMAKE_ORIG_TARGET");
if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib"))
lib.prepend("lib");
t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", escapeFilePath(lib)) << ";" << "\n";
@@ -1446,7 +1458,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if (project->isActiveConfig("debug") != (bool)as_release)
active_buildstyle = name;
t << "\t\t" << key << " = {" << "\n"
- << "\t\t\t" << writeSettings("buildRules", QStringList(), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("buildRules", ProStringList(), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << "buildSettings = {" << "\n";
for(QMap<QString, QString>::Iterator set_it = settings.begin(); set_it != settings.end(); ++set_it)
t << "\t\t\t\t" << writeSettings(set_it.key(), set_it.value()) << ";" << "\n";
@@ -1459,7 +1471,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
for (int i = 0; i < buildConfigGroups.size(); i++) {
t << "\t\t" << keyFor("QMAKE_PBX_BUILDCONFIG_LIST_" + buildConfigGroups.at(i)) << " = {" << "\n"
<< "\t\t\t" << writeSettings("isa", "XCConfigurationList", SettingsNoQuote) << ";" << "\n"
- << "\t\t\t" << writeSettings("buildConfigurations", project->values("QMAKE_PBX_BUILDCONFIGS_" + buildConfigGroups.at(i)), SettingsAsList, 4) << ";" << "\n"
+ << "\t\t\t" << writeSettings("buildConfigurations", project->values(ProKey("QMAKE_PBX_BUILDCONFIGS_" + buildConfigGroups.at(i))), SettingsAsList, 4) << ";" << "\n"
<< "\t\t\t" << writeSettings("defaultConfigurationIsVisible", "0", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("defaultConfigurationIsName", active_buildstyle) << ";" << "\n"
<< "\t\t" << "};" << "\n";
@@ -1471,7 +1483,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("isa", "PBXProject", SettingsNoQuote) << ";" << "\n"
<< "\t\t\t" << writeSettings("mainGroup", keyFor("QMAKE_PBX_ROOT_GROUP")) << ";" << "\n";
t << "\t\t\t" << writeSettings("buildConfigurationList", keyFor("QMAKE_PBX_BUILDCONFIG_LIST_PROJECT")) << ";" << "\n";
- t << "\t\t\t" << writeSettings("projectDirPath", QStringList()) << ";" << "\n"
+ t << "\t\t\t" << writeSettings("projectDirPath", ProStringList()) << ";" << "\n"
<< "\t\t\t" << writeSettings("targets", project->values("QMAKE_PBX_TARGETS"), SettingsAsList, 4) << ";" << "\n"
<< "\t\t" << "};" << "\n";
@@ -1509,9 +1521,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
QString
-ProjectBuilderMakefileGenerator::findProgram(const QString &prog)
+ProjectBuilderMakefileGenerator::findProgram(const ProString &prog)
{
- QString ret = prog;
+ QString ret = prog.toQString();
if(QDir::isRelativePath(ret)) {
QStringList paths = QString(qgetenv("PATH")).split(':');
for(int i = 0; i < paths.size(); ++i) {
@@ -1543,13 +1555,13 @@ ProjectBuilderMakefileGenerator::fixForOutput(const QString &values)
return ret;
}
-QStringList
-ProjectBuilderMakefileGenerator::fixListForOutput(const QString &where)
+ProStringList
+ProjectBuilderMakefileGenerator::fixListForOutput(const char *where)
{
- QStringList ret;
- const QStringList &l = project->values(where);
+ ProStringList ret;
+ const ProStringList &l = project->values(where);
for(int i = 0; i < l.count(); i++)
- ret += fixForOutput(l[i]);
+ ret += fixForOutput(l[i].toQString());
return ret;
}
@@ -1585,7 +1597,7 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c
if(project->first("TEMPLATE") == "subdirs" || project->isEmpty("QMAKE_ORIG_TARGET"))
output += fileInfo(project->projectFile()).baseName();
else
- output += project->first("QMAKE_ORIG_TARGET");
+ output += project->first("QMAKE_ORIG_TARGET").toQString();
}
output += projectSuffix() + QDir::separator();
} else if(output[(int)output.length() - 1] != QDir::separator()) {
@@ -1612,9 +1624,9 @@ ProjectBuilderMakefileGenerator::pbuilderVersion() const
{
QString ret;
if(!project->isEmpty("QMAKE_PBUILDER_VERSION")) {
- ret = project->first("QMAKE_PBUILDER_VERSION");
+ ret = project->first("QMAKE_PBUILDER_VERSION").toQString();
} else {
- QString version, version_plist = project->first("QMAKE_PBUILDER_VERSION_PLIST");
+ QString version, version_plist = project->first("QMAKE_PBUILDER_VERSION_PLIST").toQString();
if(version_plist.isEmpty()) {
#ifdef Q_OS_DARWIN
ret = QLatin1String("34");
@@ -1758,7 +1770,7 @@ ProjectBuilderMakefileGenerator::escapeFilePath(const QString &path) const
}
QString
-ProjectBuilderMakefileGenerator::writeSettings(QString var, QStringList vals, int flags, int indent_level)
+ProjectBuilderMakefileGenerator::writeSettings(const QString &var, const ProStringList &vals, int flags, int indent_level)
{
QString ret;
const QString quote = (flags & SettingsNoQuote) ? "" : "\"";
@@ -1769,7 +1781,7 @@ ProjectBuilderMakefileGenerator::writeSettings(QString var, QStringList vals, in
if(flags & SettingsAsList) {
ret += var + " = (" + newline;
for(int i = 0, count = 0; i < vals.size(); ++i) {
- QString val = vals.at(i);
+ QString val = vals.at(i).toQString();
if(!val.isEmpty()) {
if(count++ > 0)
ret += "," + newline;
@@ -1780,7 +1792,7 @@ ProjectBuilderMakefileGenerator::writeSettings(QString var, QStringList vals, in
} else {
ret += var + " = " + quote;
for(int i = 0; i < vals.size(); ++i) {
- QString val = vals.at(i);
+ QString val = vals.at(i).toQString();
// if(val.isEmpty())
// val = quote + quote;
if(i)
diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h
index cfda5aa9ff..62bbe1f4e0 100644
--- a/qmake/generators/mac/pbuilder_pbx.h
+++ b/qmake/generators/mac/pbuilder_pbx.h
@@ -58,15 +58,19 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
QString pbxbuild();
QHash<QString, QString> keys;
QString keyFor(const QString &file);
- QString findProgram(const QString &prog);
+ QString findProgram(const ProString &prog);
QString fixForOutput(const QString &file);
- QStringList fixListForOutput(const QString &where);
+ ProStringList fixListForOutput(const char *where);
int reftypeForFile(const QString &where);
QString projectSuffix() const;
enum { SettingsAsList=0x01, SettingsNoQuote=0x02 };
- inline QString writeSettings(QString var, QString val, int flags=0, int indent_level=0)
- { Q_UNUSED(indent_level); return writeSettings(var, QStringList(val), flags); }
- QString writeSettings(QString var, QStringList vals, int flags=0, int indent_level=0);
+ inline QString writeSettings(const QString &var, const char *val, int flags=0, int indent_level=0)
+ { return writeSettings(var, ProString(val), flags, indent_level); }
+ inline QString writeSettings(const QString &var, const QString &val, int flags=0, int indent_level=0)
+ { return writeSettings(var, ProString(val), flags, indent_level); }
+ inline QString writeSettings(const QString &var, const ProString &val, int flags=0, int indent_level=0)
+ { return writeSettings(var, ProStringList(val), flags, indent_level); }
+ QString writeSettings(const QString &var, const ProStringList &vals, int flags=0, int indent_level=0);
public:
ProjectBuilderMakefileGenerator();
@@ -76,6 +80,7 @@ public:
virtual bool openOutput(QFile &, const QString &) const;
protected:
virtual QString escapeFilePath(const QString &path) const;
+ ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); }
bool doPrecompiledHeaders() const { return false; }
virtual bool doDepends() const { return false; } //never necesary
};
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index fe389343bf..22a8b32017 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -160,19 +160,21 @@ MakefileGenerator::MakefileGenerator() :
void
MakefileGenerator::verifyCompilers()
{
- QHash<QString, QStringList> &v = project->variables();
- QStringList &quc = v["QMAKE_EXTRA_COMPILERS"];
+ ProValueMap &v = project->variables();
+ ProStringList &quc = v["QMAKE_EXTRA_COMPILERS"];
for(int i = 0; i < quc.size(); ) {
bool error = false;
- QString comp = quc.at(i);
- if(v[comp + ".output"].isEmpty()) {
- if(!v[comp + ".output_function"].isEmpty()) {
- v[comp + ".output"].append("${QMAKE_FUNC_FILE_IN_" + v[comp + ".output_function"].first() + "}");
+ const ProString &comp = quc.at(i);
+ const ProKey okey(comp + ".output");
+ if (v[okey].isEmpty()) {
+ const ProKey ofkey(comp + ".output_function");
+ if (!v[ofkey].isEmpty()) {
+ v[okey].append("${QMAKE_FUNC_FILE_IN_" + v[ofkey].first() + "}");
} else {
error = true;
warn_msg(WarnLogic, "Compiler: %s: No output file specified", comp.toLatin1().constData());
}
- } else if(v[comp + ".input"].isEmpty()) {
+ } else if (v[ProKey(comp + ".input")].isEmpty()) {
error = true;
warn_msg(WarnLogic, "Compiler: %s: No input variable specified", comp.toLatin1().constData());
}
@@ -190,12 +192,12 @@ MakefileGenerator::initOutPaths()
return;
verifyCompilers();
init_opath_already = true;
- QHash<QString, QStringList> &v = project->variables();
+ ProValueMap &v = project->variables();
//for shadow builds
if(!v.contains("QMAKE_ABSOLUTE_SOURCE_PATH")) {
if (Option::mkfile::do_cache && !project->cacheFile().isEmpty() &&
v.contains("QMAKE_ABSOLUTE_SOURCE_ROOT")) {
- QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first();
+ QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first().toQString();
root = QDir::fromNativeSeparators(root);
if(!root.isEmpty()) {
QFileInfo fi = fileInfo(project->cacheFile());
@@ -204,15 +206,15 @@ MakefileGenerator::initOutPaths()
if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) {
pwd = root + pwd.mid(cache_r.length());
if(exists(pwd))
- v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", QStringList(pwd));
+ v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", ProStringList(pwd));
}
}
}
}
}
if(!v["QMAKE_ABSOLUTE_SOURCE_PATH"].isEmpty()) {
- QString &asp = v["QMAKE_ABSOLUTE_SOURCE_PATH"].first();
- asp = QDir::fromNativeSeparators(asp);
+ ProString &asp = v["QMAKE_ABSOLUTE_SOURCE_PATH"].first();
+ asp = QDir::fromNativeSeparators(asp.toQString());
if(asp.isEmpty() || asp == Option::output_dir) //if they're the same, why bother?
v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
}
@@ -226,12 +228,13 @@ MakefileGenerator::initOutPaths()
"SUBLIBS_DIR", "DLLDESTDIR", "QMAKE_LIBTOOL_DESTDIR",
"PRECOMPILED_DIR", 0 };
for (int x = 0; dirs[x]; x++) {
- if(v[dirs[x]].isEmpty())
+ const ProKey dkey(dirs[x]);
+ if (v[dkey].isEmpty())
continue;
- const QString orig_path = v[dirs[x]].first();
+ const ProString orig_path = v[dkey].first();
- QString &pathRef = v[dirs[x]].first();
- pathRef = fileFixify(pathRef, Option::output_dir, Option::output_dir);
+ ProString &pathRef = v[dkey].first();
+ pathRef = fileFixify(pathRef.toQString(), Option::output_dir, Option::output_dir);
#ifdef Q_OS_WIN
// We don't want to add a separator for DLLDESTDIR on Windows (###why?)
@@ -245,7 +248,7 @@ MakefileGenerator::initOutPaths()
if(noIO())
continue;
- QString path = project->first(dirs[x]); //not to be changed any further
+ QString path = project->first(dkey).toQString(); //not to be changed any further
path = fileFixify(path, currentDir, Option::output_dir);
debug_msg(3, "Fixed output_dir %s (%s) into %s", dirs[x],
orig_path.toLatin1().constData(), path.toLatin1().constData());
@@ -255,17 +258,18 @@ MakefileGenerator::initOutPaths()
}
//out paths from the extra compilers
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- QString tmp_out = project->values((*it) + ".output").first();
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ QString tmp_out = project->first(ProKey(*it + ".output")).toQString();
if(tmp_out.isEmpty())
continue;
- const QStringList &tmp = project->values((*it) + ".input");
- for(QStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
- QStringList &inputs = project->values((*it2));
- for(QStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
- (*input) = fileFixify((*input), Option::output_dir, Option::output_dir);
- QString path = unescapeFilePath(replaceExtraCompilerVariables(tmp_out, (*input), QString()));
+ const ProStringList &tmp = project->values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
+ ProStringList &inputs = project->values((*it2).toKey());
+ for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
+ QString finp = fileFixify((*input).toQString(), Option::output_dir, Option::output_dir);
+ *input = ProString(finp);
+ QString path = unescapeFilePath(replaceExtraCompilerVariables(tmp_out, finp, QString()));
path = Option::fixPathToTargetOS(path);
int slash = path.lastIndexOf(Option::dir_sep);
if(slash != -1) {
@@ -282,7 +286,7 @@ MakefileGenerator::initOutPaths()
}
if(!v["DESTDIR"].isEmpty()) {
- QDir d(v["DESTDIR"].first());
+ QDir d(v["DESTDIR"].first().toQString());
if(Option::fixPathToLocalOS(d.absolutePath()) == Option::fixPathToLocalOS(Option::output_dir))
v.remove("DESTDIR");
}
@@ -313,16 +317,17 @@ MakefileGenerator::setProjectFile(QMakeProject *p)
processPrlFiles();
}
-QStringList
-MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &vpath_var)
+ProStringList
+MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString &vpath_var)
{
- QStringList vpath;
- const QHash<QString, QStringList> &v = project->variables();
+ ProStringList vpath;
+ const ProValueMap &v = project->variables();
for(int val_it = 0; val_it < l.count(); ) {
bool remove_file = false;
- QString &val = l[val_it];
+ ProString &val = l[val_it];
if(!val.isEmpty()) {
- QString file = fixEnvVariables(val);
+ QString qval = val.toQString();
+ QString file = fixEnvVariables(qval);
if(!(flags & VPATH_NoFixify))
file = fileFixify(file, qmake_getpwd(), Option::output_dir);
if (file.at(0) == '\"' && file.at(file.length() - 1) == '\"')
@@ -333,24 +338,24 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
continue;
}
bool found = false;
- if(QDir::isRelativePath(val)) {
+ if (QDir::isRelativePath(qval)) {
if(vpath.isEmpty()) {
if(!vpath_var.isEmpty())
- vpath = v[vpath_var];
+ vpath = v[ProKey(vpath_var)];
vpath += v["VPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"] + v["DEPENDPATH"];
if(Option::output_dir != qmake_getpwd())
- vpath += Option::output_dir;
+ vpath << Option::output_dir;
}
- for(QStringList::Iterator vpath_it = vpath.begin();
+ for (ProStringList::Iterator vpath_it = vpath.begin();
vpath_it != vpath.end(); ++vpath_it) {
- QString real_dir = Option::fixPathToLocalOS((*vpath_it));
+ QString real_dir = Option::fixPathToLocalOS((*vpath_it).toQString());
if(exists(real_dir + QDir::separator() + val)) {
- QString dir = (*vpath_it);
+ ProString dir = (*vpath_it);
if(!dir.endsWith(Option::dir_sep))
dir += Option::dir_sep;
val = dir + val;
if(!(flags & VPATH_NoFixify))
- val = fileFixify(val);
+ val = fileFixify(val.toQString());
found = true;
debug_msg(1, "Found file through vpath %s -> %s",
file.toLatin1().constData(), val.toLatin1().constData());
@@ -359,7 +364,7 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
}
}
if(!found) {
- QString dir, regex = val, real_dir;
+ QString dir, regex = val.toQString(), real_dir;
if(regex.lastIndexOf(Option::dir_sep) != -1) {
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
real_dir = dir;
@@ -411,8 +416,8 @@ MakefileGenerator::findFilesInVPATH(QStringList l, uchar flags, const QString &v
void
MakefileGenerator::initCompiler(const MakefileGenerator::Compiler &comp)
{
- QHash<QString, QStringList> &v = project->variables();
- QStringList &l = v[comp.variable_in];
+ ProValueMap &v = project->variables();
+ ProStringList &l = v[ProKey(comp.variable_in)];
// find all the relevant file inputs
if(!init_compiler_already.contains(comp.variable_in)) {
init_compiler_already.insert(comp.variable_in, true);
@@ -431,7 +436,7 @@ MakefileGenerator::init()
verifyCompilers();
init_already = true;
- QHash<QString, QStringList> &v = project->variables();
+ ProValueMap &v = project->variables();
chkdir = v["QMAKE_CHK_DIR_EXISTS"].join(" ");
chkfile = v["QMAKE_CHK_FILE_EXISTS"].join(" ");
@@ -441,26 +446,31 @@ MakefileGenerator::init()
if (chkglue.isEmpty()) // Backwards compat with Qt4 specs
chkglue = isWindowsShell() ? "" : "|| ";
- QStringList &quc = v["QMAKE_EXTRA_COMPILERS"];
+ ProStringList &quc = v["QMAKE_EXTRA_COMPILERS"];
//make sure the COMPILERS are in the correct input/output chain order
for(int comp_out = 0, jump_count = 0; comp_out < quc.size(); ++comp_out) {
continue_compiler_chain:
if(jump_count > quc.size()) //just to avoid an infinite loop here
break;
- if (v.contains(quc.at(comp_out) + ".variable_out")) {
- const QStringList &outputs = v.value(quc.at(comp_out) + ".variable_out");
+ const ProKey vokey(quc.at(comp_out) + ".variable_out");
+ if (v.contains(vokey)) {
+ const ProStringList &outputs = v.value(vokey);
for(int out = 0; out < outputs.size(); ++out) {
for(int comp_in = 0; comp_in < quc.size(); ++comp_in) {
if(comp_in == comp_out)
continue;
- if (v.contains(quc.at(comp_in) + ".input")) {
- const QStringList &inputs = v.value(quc.at(comp_in) + ".input");
+ const ProKey ikey(quc.at(comp_in) + ".input");
+ if (v.contains(ikey)) {
+ const ProStringList &inputs = v.value(ikey);
for(int in = 0; in < inputs.size(); ++in) {
if(inputs.at(in) == outputs.at(out) && comp_out > comp_in) {
++jump_count;
//move comp_out to comp_in and continue the compiler chain
- quc.move(comp_out, comp_in);
+ // quc.move(comp_out, comp_in);
+ quc.insert(comp_in, quc.value(comp_out));
+ // comp_out > comp_in, so the insertion did move everything up
+ quc.remove(comp_out + 1);
comp_out = comp_in;
goto continue_compiler_chain;
}
@@ -472,33 +482,35 @@ MakefileGenerator::init()
}
if(!project->isEmpty("QMAKE_SUBSTITUTES")) {
- const QStringList &subs = v["QMAKE_SUBSTITUTES"];
+ const ProStringList &subs = v["QMAKE_SUBSTITUTES"];
for(int i = 0; i < subs.size(); ++i) {
- QString inn = subs.at(i) + ".input", outn = subs.at(i) + ".output";
- if (v.contains(inn) || v.contains(outn)) {
- if (!v.contains(inn) || !v.contains(outn)) {
+ QString sub = subs.at(i).toQString();
+ QString inn = sub + ".input", outn = sub + ".output";
+ const ProKey innkey(inn), outnkey(outn);
+ if (v.contains(innkey) || v.contains(outnkey)) {
+ if (!v.contains(innkey) || !v.contains(outnkey)) {
warn_msg(WarnLogic, "Substitute '%s' has only one of .input and .output",
- subs.at(i).toLatin1().constData());
+ sub.toLatin1().constData());
continue;
}
- const QStringList &tinn = v[inn], &toutn = v[outn];
+ const ProStringList &tinn = v[innkey], &toutn = v[outnkey];
if (tinn.length() != 1) {
warn_msg(WarnLogic, "Substitute '%s.input' does not have exactly one value",
- subs.at(i).toLatin1().constData());
+ sub.toLatin1().constData());
continue;
}
if (toutn.length() != 1) {
warn_msg(WarnLogic, "Substitute '%s.output' does not have exactly one value",
- subs.at(i).toLatin1().constData());
+ sub.toLatin1().constData());
continue;
}
- inn = fileFixify(tinn.first(), qmake_getpwd());
- outn = fileFixify(toutn.first(), qmake_getpwd(), Option::output_dir);
+ inn = fileFixify(tinn.first().toQString(), qmake_getpwd());
+ outn = fileFixify(toutn.first().toQString(), qmake_getpwd(), Option::output_dir);
} else {
- inn = fileFixify(subs.at(i), qmake_getpwd());
+ inn = fileFixify(sub, qmake_getpwd());
if (!QFile::exists(inn)) {
// random insanity for backwards compat: .in file specified with absolute out dir
- inn = fileFixify(subs.at(i));
+ inn = fileFixify(sub);
}
if(!inn.endsWith(".in")) {
warn_msg(WarnLogic, "Substitute '%s' does not end with '.in'",
@@ -508,7 +520,7 @@ MakefileGenerator::init()
outn = fileFixify(inn.left(inn.length()-3), qmake_getpwd(), Option::output_dir);
}
- QString confign = subs.at(i) + ".CONFIG";
+ const ProKey confign(sub + ".CONFIG");
bool verbatim = false;
if (v.contains(confign))
verbatim = v[confign].contains(QLatin1String("verbatim"));
@@ -615,22 +627,24 @@ MakefileGenerator::init()
compiler.flags |= Compiler::CompilerNoCheckDeps;
compilers.append(compiler);
}
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- const QStringList &inputs = v[(*it) + ".input"];
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ const ProStringList &inputs = v[ProKey(*it + ".input")];
for(x = 0; x < inputs.size(); ++x) {
Compiler compiler;
- compiler.variable_in = inputs.at(x);
+ compiler.variable_in = inputs.at(x).toQString();
compiler.flags = Compiler::CompilerNoFlags;
- if(v[(*it) + ".CONFIG"].indexOf("ignore_no_exist") != -1)
+ const ProStringList &config = v[ProKey(*it + ".CONFIG")];
+ if (config.indexOf("ignore_no_exist") != -1)
compiler.flags |= Compiler::CompilerRemoveNoExist;
- if(v[(*it) + ".CONFIG"].indexOf("no_dependencies") != -1)
+ if (config.indexOf("no_dependencies") != -1)
compiler.flags |= Compiler::CompilerNoCheckDeps;
- if(v[(*it) + ".CONFIG"].indexOf("add_inputs_as_makefile_deps") != -1)
+ if (config.indexOf("add_inputs_as_makefile_deps") != -1)
compiler.flags |= Compiler::CompilerAddInputsAsMakefileDeps;
- QString dep_type;
- if(!project->isEmpty((*it) + ".dependency_type"))
- dep_type = project->first((*it) + ".dependency_type");
+ const ProKey dkey(*it + ".dependency_type");
+ ProString dep_type;
+ if (!project->isEmpty(dkey))
+ dep_type = project->first(dkey);
if (dep_type.isEmpty())
compiler.type = QMakeSourceFileInfo::TYPE_UNKNOWN;
else if(dep_type == "TYPE_UI")
@@ -642,19 +656,20 @@ MakefileGenerator::init()
}
}
{ //do the path fixifying
- QStringList paths;
+ ProStringList paths;
for(x = 0; x < compilers.count(); ++x) {
if(!paths.contains(compilers.at(x).variable_in))
paths << compilers.at(x).variable_in;
}
paths << "INCLUDEPATH" << "QMAKE_INTERNAL_INCLUDED_FILES" << "PRECOMPILED_HEADER";
for(int y = 0; y < paths.count(); y++) {
- QStringList &l = v[paths[y]];
- for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ ProStringList &l = v[paths[y].toKey()];
+ for (ProStringList::Iterator it = l.begin(); it != l.end(); ++it) {
if((*it).isEmpty())
continue;
- if(exists((*it)))
- (*it) = fileFixify((*it));
+ QString fn = (*it).toQString();
+ if (exists(fn))
+ (*it) = fileFixify(fn);
}
}
}
@@ -666,85 +681,89 @@ MakefileGenerator::init()
//merge actual compiler outputs into their variable_out. This is done last so that
//files are already properly fixified.
- for(QStringList::Iterator it = quc.begin(); it != quc.end(); ++it) {
- QString tmp_out = project->values((*it) + ".output").first();
+ for (ProStringList::Iterator it = quc.begin(); it != quc.end(); ++it) {
+ const ProKey ikey(*it + ".input");
+ const ProKey vokey(*it + ".variable_out");
+ const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
+ const ProString &tmp_out = project->values(ProKey(*it + ".output")).first();
if(tmp_out.isEmpty())
continue;
- if(project->values((*it) + ".CONFIG").indexOf("combine") != -1) {
- const QStringList &compilerInputs = project->values((*it) + ".input");
+ if (config.indexOf("combine") != -1) {
+ const ProStringList &compilerInputs = project->values(ikey);
// Don't generate compiler output if it doesn't have input.
- if (compilerInputs.isEmpty() || project->values(compilerInputs.first()).isEmpty())
+ if (compilerInputs.isEmpty() || project->values(compilerInputs.first().toKey()).isEmpty())
continue;
if(tmp_out.indexOf("$") == -1) {
if(!verifyExtraCompiler((*it), QString())) //verify
continue;
- QString out = fileFixify(tmp_out, Option::output_dir, Option::output_dir);
- bool pre_dep = (project->values((*it) + ".CONFIG").indexOf("target_predeps") != -1);
- if (v.contains((*it) + ".variable_out")) {
- const QStringList &var_out = v.value((*it) + ".variable_out");
+ QString out = fileFixify(tmp_out.toQString(), Option::output_dir, Option::output_dir);
+ bool pre_dep = (config.indexOf("target_predeps") != -1);
+ if (v.contains(vokey)) {
+ const ProStringList &var_out = v.value(vokey);
for(int i = 0; i < var_out.size(); ++i) {
- QString v = var_out.at(i);
+ ProKey v = var_out.at(i).toKey();
if(v == QLatin1String("SOURCES"))
v = "GENERATED_SOURCES";
else if(v == QLatin1String("OBJECTS"))
pre_dep = false;
- QStringList &list = project->values(v);
+ ProStringList &list = project->values(v);
if(!list.contains(out))
list.append(out);
}
- } else if(project->values((*it) + ".CONFIG").indexOf("no_link") == -1) {
- QStringList &list = project->values("OBJECTS");
+ } else if (config.indexOf("no_link") == -1) {
+ ProStringList &list = project->values("OBJECTS");
pre_dep = false;
if(!list.contains(out))
list.append(out);
} else {
- QStringList &list = project->values("UNUSED_SOURCES");
+ ProStringList &list = project->values("UNUSED_SOURCES");
if(!list.contains(out))
list.append(out);
}
if(pre_dep) {
- QStringList &list = project->values("PRE_TARGETDEPS");
+ ProStringList &list = project->values("PRE_TARGETDEPS");
if(!list.contains(out))
list.append(out);
}
}
} else {
- const QStringList &tmp = project->values((*it) + ".input");
- for (QStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
- const QStringList inputs = project->values((*it2));
- for(QStringList::ConstIterator input = inputs.constBegin(); input != inputs.constEnd(); ++input) {
+ const ProStringList &tmp = project->values(ikey);
+ for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
+ const ProStringList &inputs = project->values((*it2).toKey());
+ for (ProStringList::ConstIterator input = inputs.constBegin(); input != inputs.constEnd(); ++input) {
if((*input).isEmpty())
continue;
- QString in = Option::fixPathToTargetOS((*input), false);
- if(!verifyExtraCompiler((*it), in)) //verify
+ QString inpf = (*input).toQString();
+ QString in = Option::fixPathToTargetOS(inpf, false);
+ if (!verifyExtraCompiler((*it).toQString(), in)) //verify
continue;
- QString out = replaceExtraCompilerVariables(tmp_out, (*input), QString());
+ QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString());
out = fileFixify(out, Option::output_dir, Option::output_dir);
- bool pre_dep = (project->values((*it) + ".CONFIG").indexOf("target_predeps") != -1);
- if (v.contains((*it) + ".variable_out")) {
- const QStringList &var_out = project->values(*it + ".variable_out");
+ bool pre_dep = (config.indexOf("target_predeps") != -1);
+ if (v.contains(vokey)) {
+ const ProStringList &var_out = project->values(vokey);
for(int i = 0; i < var_out.size(); ++i) {
- QString v = var_out.at(i);
+ ProKey v = var_out.at(i).toKey();
if(v == QLatin1String("SOURCES"))
v = "GENERATED_SOURCES";
else if(v == QLatin1String("OBJECTS"))
pre_dep = false;
- QStringList &list = project->values(v);
+ ProStringList &list = project->values(v);
if(!list.contains(out))
list.append(out);
}
- } else if(project->values((*it) + ".CONFIG").indexOf("no_link") == -1) {
+ } else if (config.indexOf("no_link") == -1) {
pre_dep = false;
- QStringList &list = project->values("OBJECTS");
+ ProStringList &list = project->values("OBJECTS");
if(!list.contains(out))
list.append(out);
} else {
- QStringList &list = project->values("UNUSED_SOURCES");
+ ProStringList &list = project->values("UNUSED_SOURCES");
if(!list.contains(out))
list.append(out);
}
if(pre_dep) {
- QStringList &list = project->values("PRE_TARGETDEPS");
+ ProStringList &list = project->values("PRE_TARGETDEPS");
if(!list.contains(out))
list.append(out);
}
@@ -757,7 +776,7 @@ MakefileGenerator::init()
depHeuristicsCache.clear();
if(!noIO()) {
// dependency paths
- QStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"];
+ ProStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"];
if(project->isActiveConfig("depend_includepath"))
incDirs += v["INCLUDEPATH"];
if(!project->isActiveConfig("no_include_pwd")) {
@@ -767,15 +786,15 @@ MakefileGenerator::init()
incDirs += pwd;
}
QList<QMakeLocalFileName> deplist;
- for(QStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
- deplist.append(QMakeLocalFileName(unescapeFilePath((*it))));
+ for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
+ deplist.append(QMakeLocalFileName(unescapeFilePath((*it).toQString())));
QMakeSourceFileInfo::setDependencyPaths(deplist);
debug_msg(1, "Dependency Directories: %s", incDirs.join(" :: ").toLatin1().constData());
//cache info
if(project->isActiveConfig("qmake_cache")) {
QString cache_file;
if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) {
- cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE"));
+ cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE").toQString());
} else {
cache_file = ".qmake.internal.cache";
if(project->isActiveConfig("build_pass"))
@@ -790,11 +809,12 @@ MakefileGenerator::init()
for(x = 0; x < compilers.count(); ++x) {
const MakefileGenerator::Compiler &comp = compilers.at(x);
if(!(comp.flags & Compiler::CompilerNoCheckDeps)) {
- addSourceFiles(v[comp.variable_in], QMakeSourceFileInfo::SEEK_DEPS,
+ const ProKey ikey(comp.variable_in);
+ addSourceFiles(v[ikey], QMakeSourceFileInfo::SEEK_DEPS,
(QMakeSourceFileInfo::SourceFileType)comp.type);
if (comp.flags & Compiler::CompilerAddInputsAsMakefileDeps) {
- QStringList &l = v[comp.variable_in];
+ ProStringList &l = v[ikey];
for (int i=0; i < l.size(); ++i) {
if(v["QMAKE_INTERNAL_INCLUDED_FILES"].indexOf(l.at(i)) == -1)
v["QMAKE_INTERNAL_INCLUDED_FILES"].append(l.at(i));
@@ -811,9 +831,9 @@ MakefileGenerator::init()
//Translation files
if(!project->isEmpty("TRANSLATIONS")) {
- QStringList &trf = project->values("TRANSLATIONS");
- for(QStringList::Iterator it = trf.begin(); it != trf.end(); ++it)
- (*it) = Option::fixPathToLocalOS((*it));
+ ProStringList &trf = project->values("TRANSLATIONS");
+ for (ProStringList::Iterator it = trf.begin(); it != trf.end(); ++it)
+ (*it) = Option::fixPathToLocalOS((*it).toQString());
}
if(!project->isActiveConfig("no_include_pwd")) { //get the output_dir into the pwd
@@ -824,26 +844,27 @@ MakefileGenerator::init()
//fix up the target deps
static const char * const fixpaths[] = { "PRE_TARGETDEPS", "POST_TARGETDEPS", 0 };
for (int path = 0; fixpaths[path]; path++) {
- QStringList &l = v[fixpaths[path]];
- for(QStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
+ ProStringList &l = v[fixpaths[path]];
+ for (ProStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) {
if(!(*val_it).isEmpty())
- (*val_it) = escapeDependencyPath(Option::fixPathToTargetOS((*val_it), false, false));
+ (*val_it) = escapeDependencyPath(Option::fixPathToTargetOS((*val_it).toQString(), false, false));
}
}
//extra depends
if(!project->isEmpty("DEPENDS")) {
- QStringList &l = v["DEPENDS"];
- for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) {
- QStringList files = v[(*it) + ".file"] + v[(*it) + ".files"]; //why do I support such evil things?
- for(QStringList::Iterator file_it = files.begin(); file_it != files.end(); ++file_it) {
- QStringList &out_deps = findDependencies(*file_it);
- QStringList &in_deps = v[(*it) + ".depends"]; //even more evilness..
- for(QStringList::Iterator dep_it = in_deps.begin(); dep_it != in_deps.end(); ++dep_it) {
- if(exists(*dep_it)) {
- out_deps.append(*dep_it);
+ ProStringList &l = v["DEPENDS"];
+ for (ProStringList::Iterator it = l.begin(); it != l.end(); ++it) {
+ const ProStringList &files = v[ProKey(*it + ".file")] + v[ProKey(*it + ".files")]; //why do I support such evil things?
+ for (ProStringList::ConstIterator file_it = files.begin(); file_it != files.end(); ++file_it) {
+ QStringList &out_deps = findDependencies((*file_it).toQString());
+ const ProStringList &in_deps = v[ProKey(*it + ".depends")]; //even more evilness..
+ for (ProStringList::ConstIterator dep_it = in_deps.begin(); dep_it != in_deps.end(); ++dep_it) {
+ QString dep = (*dep_it).toQString();
+ if (exists(dep)) {
+ out_deps.append(dep);
} else {
- QString dir, regex = Option::fixPathToLocalOS((*dep_it));
+ QString dir, regex = Option::fixPathToLocalOS(dep);
if(regex.lastIndexOf(Option::dir_sep) != -1) {
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
regex.remove(0, dir.length());
@@ -851,7 +872,7 @@ MakefileGenerator::init()
QStringList files = QDir(dir).entryList(QStringList(regex));
if(files.isEmpty()) {
warn_msg(WarnLogic, "Dependency for [%s]: Not found %s", (*file_it).toLatin1().constData(),
- (*dep_it).toLatin1().constData());
+ dep.toLatin1().constData());
} else {
for(int i = 0; i < files.count(); i++)
out_deps.append(dir + files[i]);
@@ -864,7 +885,7 @@ MakefileGenerator::init()
// escape qmake command
project->values("QMAKE_QMAKE") =
- escapeFilePaths(QStringList(Option::fixPathToTargetOS(Option::qmake_abslocation, false)));
+ ProStringList(escapeFilePath(Option::fixPathToTargetOS(Option::qmake_abslocation, false)));
}
bool
@@ -897,9 +918,9 @@ MakefileGenerator::processPrlFile(QString &file)
} else {
ret = true;
project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS");
- QStringList &defs = project->values("DEFINES");
- const QStringList &prl_defs = project->values("PRL_EXPORT_DEFINES");
- foreach (const QString &def, libinfo.values("QMAKE_PRL_DEFINES"))
+ ProStringList &defs = project->values("DEFINES");
+ const ProStringList &prl_defs = project->values("PRL_EXPORT_DEFINES");
+ foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES"))
if (!defs.contains(def) && prl_defs.contains(def))
defs.append(def);
if(try_replace_file && !libinfo.isEmpty("QMAKE_PRL_TARGET")) {
@@ -907,7 +928,7 @@ MakefileGenerator::processPrlFile(QString &file)
int slsh = real_meta_file.lastIndexOf(Option::dir_sep);
if(slsh != -1)
dir = real_meta_file.left(slsh+1);
- file = libinfo.first("QMAKE_PRL_TARGET");
+ file = libinfo.first("QMAKE_PRL_TARGET").toQString();
if(QDir::isRelativePath(file))
file.prepend(dir);
}
@@ -934,9 +955,9 @@ MakefileGenerator::processPrlFile(QString &file)
void
MakefileGenerator::filterIncludedFiles(const char *var)
{
- QStringList &inputs = project->values(var);
- for(QStringList::Iterator input = inputs.begin(); input != inputs.end(); ) {
- if(QMakeSourceFileInfo::included((*input)) > 0)
+ ProStringList &inputs = project->values(var);
+ for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ) {
+ if (QMakeSourceFileInfo::included((*input).toQString()) > 0)
input = inputs.erase(input);
else
++input;
@@ -952,10 +973,10 @@ MakefileGenerator::processPrlFiles()
void
MakefileGenerator::writePrlFile(QTextStream &t)
{
- QString target = project->first("TARGET");
+ ProString target = project->first("TARGET");
int slsh = target.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- target.remove(0, slsh + 1);
+ target.chopFront(slsh + 1);
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
@@ -979,7 +1000,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
else if(!project->isEmpty("VERSION"))
t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << endl;
if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib")) {
- QStringList libs;
+ ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS"))
libs = project->values("QMAKE_INTERNAL_PRL_LIBS");
else
@@ -987,8 +1008,8 @@ MakefileGenerator::writePrlFile(QTextStream &t)
if(project->isActiveConfig("staticlib"))
libs << "QMAKE_LIBS_PRIVATE";
t << "QMAKE_PRL_LIBS = ";
- for(QStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
- t << project->values((*it)).join(" ").replace('\\', "\\\\") << " ";
+ for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
+ t << project->values((*it).toKey()).join(" ").replace('\\', "\\\\") << " ";
t << endl;
}
}
@@ -1003,13 +1024,14 @@ MakefileGenerator::writeProjectMakefile()
QList<SubTarget*> targets;
{
- QStringList builds = project->values("BUILDS");
- for(QStringList::Iterator it = builds.begin(); it != builds.end(); ++it) {
+ ProStringList builds = project->values("BUILDS");
+ for (ProStringList::Iterator it = builds.begin(); it != builds.end(); ++it) {
SubTarget *st = new SubTarget;
targets.append(st);
st->makefile = "$(MAKEFILE)." + (*it);
- st->name = (*it);
- st->target = project->isEmpty((*it) + ".target") ? (*it) : project->first((*it) + ".target");
+ st->name = (*it).toQString();
+ const ProKey tkey(*it + ".target");
+ st->target = (project->isEmpty(tkey) ? (*it) : project->first(tkey)).toQString();
}
}
if(project->isActiveConfig("build_all")) {
@@ -1068,9 +1090,9 @@ MakefileGenerator::write()
QString
MakefileGenerator::prlFileName(bool fixify)
{
- QString ret = project->first("TARGET_PRL");;
+ QString ret = project->first("TARGET_PRL").toQString();
if(ret.isEmpty())
- ret = project->first("TARGET");
+ ret = project->first("TARGET").toQString();
int slsh = ret.lastIndexOf(Option::dir_sep);
if(slsh != -1)
ret.remove(0, slsh);
@@ -1084,7 +1106,7 @@ MakefileGenerator::prlFileName(bool fixify)
ret.prepend(project->first("QMAKE_BUNDLE") + Option::dir_sep);
if(fixify) {
if(!project->isEmpty("DESTDIR"))
- ret.prepend(project->first("DESTDIR"));
+ ret.prepend(project->first("DESTDIR").toQString());
ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir));
}
return ret;
@@ -1116,20 +1138,23 @@ MakefileGenerator::writePrlFile()
void
MakefileGenerator::writeObj(QTextStream &t, const char *src)
{
- const QStringList &srcl = project->values(src);
- const QStringList objl = createObjectList(srcl);
+ const ProStringList &srcl = project->values(src);
+ const ProStringList objl = createObjectList(srcl);
- QStringList::ConstIterator oit = objl.begin();
- QStringList::ConstIterator sit = srcl.begin();
+ ProStringList::ConstIterator oit = objl.begin();
+ ProStringList::ConstIterator sit = srcl.begin();
QString stringSrc("$src");
QString stringObj("$obj");
for(;sit != srcl.end() && oit != objl.end(); ++oit, ++sit) {
if((*sit).isEmpty())
continue;
- t << escapeDependencyPath((*oit)) << ": " << escapeDependencyPath((*sit)) << " " << escapeDependencyPaths(findDependencies((*sit))).join(" \\\n\t\t");
+ QString srcf = (*sit).toQString();
+ QString dstf = (*oit).toQString();
+ t << escapeDependencyPath(dstf) << ": " << escapeDependencyPath(srcf)
+ << " " << escapeDependencyPaths(findDependencies(srcf)).join(" \\\n\t\t");
- QString comp, cimp;
+ ProKey comp, cimp;
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) {
if((*sit).endsWith((*cppit))) {
comp = "QMAKE_RUN_CXX";
@@ -1153,9 +1178,9 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
}
}
if (!use_implicit_rule && !project->isEmpty(comp)) {
- QString p = var(comp), srcf(*sit);
+ QString p = var(comp);
p.replace(stringSrc, escapeFilePath(srcf));
- p.replace(stringObj, escapeFilePath((*oit)));
+ p.replace(stringObj, escapeFilePath(dstf));
t << "\n\t" << p;
}
t << endl << endl;
@@ -1174,7 +1199,7 @@ MakefileGenerator::filePrefixRoot(const QString &root, const QString &path)
}
void
-MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool noBuild)
+MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
{
QString rm_dir_contents("-$(DEL_FILE)");
if (!isWindowsShell()) //ick
@@ -1182,11 +1207,12 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
QString all_installs, all_uninstalls;
QSet<QString> made_dirs, removed_dirs;
- const QStringList &l = project->values(installs);
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- QString pvar = (*it) + ".path";
- if(project->values((*it) + ".CONFIG").indexOf("no_path") == -1 &&
- project->values((*it) + ".CONFIG").indexOf("dummy_install") == -1 &&
+ const ProStringList &l = project->values("INSTALLS");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ const ProKey pvar(*it + ".path");
+ const ProStringList &installConfigValues = project->values(ProKey(*it + ".CONFIG"));
+ if (installConfigValues.indexOf("no_path") == -1 &&
+ installConfigValues.indexOf("dummy_install") == -1 &&
project->values(pvar).isEmpty()) {
warn_msg(WarnLogic, "%s is not defined: install target not created\n", pvar.toLatin1().constData());
continue;
@@ -1195,28 +1221,28 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
bool do_default = true;
const QString root = "$(INSTALL_ROOT)";
QString dst;
- if(project->values((*it) + ".CONFIG").indexOf("no_path") == -1 &&
- project->values((*it) + ".CONFIG").indexOf("dummy_install") == -1) {
- dst = fileFixify(unescapeFilePath(project->values(pvar).first()), FileFixifyAbsolute, false);
+ if (installConfigValues.indexOf("no_path") == -1 &&
+ installConfigValues.indexOf("dummy_install") == -1) {
+ dst = fileFixify(unescapeFilePath(project->first(pvar).toQString()), FileFixifyAbsolute, false);
if(!dst.endsWith(Option::dir_sep))
dst += Option::dir_sep;
}
QStringList tmp, inst, uninst;
//other
- tmp = project->values((*it) + ".extra");
- if(tmp.isEmpty())
- tmp = project->values((*it) + ".commands"); //to allow compatible name
- if(!tmp.isEmpty()) {
+ ProStringList tmp2 = project->values(ProKey(*it + ".extra"));
+ if (tmp2.isEmpty())
+ tmp2 = project->values(ProKey(*it + ".commands")); //to allow compatible name
+ if (!tmp2.isEmpty()) {
do_default = false;
- inst << tmp.join(" ");
+ inst << tmp2.join(" ");
}
//masks
- tmp = findFilesInVPATH(project->values((*it) + ".files"), VPATH_NoFixify);
- tmp = fileFixify(tmp, FileFixifyAbsolute);
+ tmp2 = findFilesInVPATH(project->values(ProKey(*it + ".files")), VPATH_NoFixify);
+ tmp = fileFixify(tmp2.toQStringList(), FileFixifyAbsolute);
if(!tmp.isEmpty()) {
do_default = false;
- QString base_path = project->first((*it) + ".base");
+ QString base_path = project->first(ProKey(*it + ".base")).toQString();
if (!base_path.isEmpty()) {
base_path = Option::fixPathToTargetOS(base_path, false, true);
if (!base_path.endsWith(Option::dir_sep))
@@ -1236,7 +1262,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
if (!base_path.isEmpty()) {
if (!dirstr.startsWith(base_path)) {
warn_msg(WarnLogic, "File %s in install rule %s does not start with base %s",
- qPrintable(wild), qPrintable(*it), qPrintable(base_path));
+ qPrintable(wild), qPrintable((*it).toQString()),
+ qPrintable(base_path));
} else {
QString dir_sfx = dirstr.mid(base_path.length());
dst_dir += dir_sfx;
@@ -1286,7 +1313,6 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
}
QString local_dirstr = Option::fixPathToLocalOS(dirstr, true);
QStringList files = QDir(local_dirstr).entryList(QStringList(filestr));
- const QStringList &installConfigValues = project->values((*it) + ".CONFIG");
if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
QString dst_file = filePrefixRoot(root, dst_dir);
QString cmd;
@@ -1331,33 +1357,33 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
QString target;
//default?
if (do_default)
- target = defaultInstall((*it));
+ target = defaultInstall((*it).toQString());
else
target = inst.join("\n\t");
- QString puninst = project->values((*it) + ".uninstall").join(" ");
+ QString puninst = project->values(ProKey(*it + ".uninstall")).join(" ");
if (!puninst.isEmpty())
uninst << puninst;
- if(!target.isEmpty() || project->values((*it) + ".CONFIG").indexOf("dummy_install") != -1) {
- if(noBuild || project->values((*it) + ".CONFIG").indexOf("no_build") != -1)
+ if (!target.isEmpty() || installConfigValues.indexOf("dummy_install") != -1) {
+ if (noBuild || installConfigValues.indexOf("no_build") != -1)
t << "install_" << (*it) << ":";
else if(project->isActiveConfig("build_all"))
t << "install_" << (*it) << ": all";
else
t << "install_" << (*it) << ": first";
- const QStringList &deps = project->values((*it) + ".depends");
+ const ProStringList &deps = project->values(ProKey(*it + ".depends"));
if(!deps.isEmpty()) {
- for(QStringList::ConstIterator dep_it = deps.begin(); dep_it != deps.end(); ++dep_it) {
- QString targ = var((*dep_it) + ".target");
+ for (ProStringList::ConstIterator dep_it = deps.begin(); dep_it != deps.end(); ++dep_it) {
+ QString targ = var(ProKey(*dep_it + ".target"));
if(targ.isEmpty())
- targ = (*dep_it);
+ targ = (*dep_it).toQString();
t << " " << escapeDependencyPath(targ);
}
}
t << " FORCE\n\t";
- const QStringList &dirs = project->values(pvar);
- for(QStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) {
- QString tmp_dst = fileFixify((*pit), FileFixifyAbsolute, false);
+ const ProStringList &dirs = project->values(pvar);
+ for (ProStringList::ConstIterator pit = dirs.begin(); pit != dirs.end(); ++pit) {
+ QString tmp_dst = fileFixify((*pit).toQString(), FileFixifyAbsolute, false);
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
}
t << target << endl << endl;
@@ -1369,7 +1395,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
}
t << endl;
- if(project->values((*it) + ".CONFIG").indexOf("no_default_install") == -1) {
+ if (installConfigValues.indexOf("no_default_install") == -1) {
all_installs += QString("install_") + (*it) + " ";
if(!uninst.isEmpty())
all_uninstalls += "uninstall_" + (*it) + " ";
@@ -1384,33 +1410,53 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
}
QString
-MakefileGenerator::var(const QString &var)
+MakefileGenerator::var(const ProKey &var)
{
return val(project->values(var));
}
QString
+MakefileGenerator::val(const ProStringList &varList)
+{
+ return valGlue(varList, "", " ", "");
+}
+
+QString
MakefileGenerator::val(const QStringList &varList)
{
return valGlue(varList, "", " ", "");
}
QString
-MakefileGenerator::varGlue(const QString &var, const QString &before, const QString &glue, const QString &after)
+MakefileGenerator::varGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after)
{
return valGlue(project->values(var), before, glue, after);
}
QString
-MakefileGenerator::fileVarGlue(const QString &var, const QString &before, const QString &glue, const QString &after)
+MakefileGenerator::fileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after)
{
- QStringList varList;
- foreach (const QString &val, project->values(var))
- varList << escapeFilePath(Option::fixPathToTargetOS(val));
+ ProStringList varList;
+ foreach (const ProString &val, project->values(var))
+ varList << escapeFilePath(Option::fixPathToTargetOS(val.toQString()));
return valGlue(varList, before, glue, after);
}
QString
+MakefileGenerator::valGlue(const ProStringList &varList, const QString &before, const QString &glue, const QString &after)
+{
+ QString ret;
+ for (ProStringList::ConstIterator it = varList.begin(); it != varList.end(); ++it) {
+ if (!(*it).isEmpty()) {
+ if (!ret.isEmpty())
+ ret += glue;
+ ret += (*it).toQString();
+ }
+ }
+ return ret.isEmpty() ? QString("") : before + ret + after;
+}
+
+QString
MakefileGenerator::valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after)
{
QString ret;
@@ -1426,30 +1472,37 @@ MakefileGenerator::valGlue(const QStringList &varList, const QString &before, co
QString
-MakefileGenerator::varList(const QString &var)
+MakefileGenerator::varList(const ProKey &var)
{
return valList(project->values(var));
}
QString
+MakefileGenerator::valList(const ProStringList &varList)
+{
+ return valGlue(varList, "", " \\\n\t\t", "");
+}
+
+QString
MakefileGenerator::valList(const QStringList &varList)
{
return valGlue(varList, "", " \\\n\t\t", "");
}
-QStringList
-MakefileGenerator::createObjectList(const QStringList &sources)
+ProStringList
+MakefileGenerator::createObjectList(const ProStringList &sources)
{
- QStringList ret;
+ ProStringList ret;
QString objdir;
if(!project->values("OBJECTS_DIR").isEmpty())
- objdir = project->first("OBJECTS_DIR");
- for(QStringList::ConstIterator it = sources.begin(); it != sources.end(); ++it) {
- QFileInfo fi(fileInfo(Option::fixPathToLocalOS((*it))));
+ objdir = project->first("OBJECTS_DIR").toQString();
+ for (ProStringList::ConstIterator it = sources.begin(); it != sources.end(); ++it) {
+ QString sfn = (*it).toQString();
+ QFileInfo fi(fileInfo(Option::fixPathToLocalOS(sfn)));
QString dir;
if (project->isActiveConfig("object_parallel_to_source")) {
// The source paths are relative to the output dir, but we need source-relative paths
- QString sourceRelativePath = fileFixify(*it, qmake_getpwd(), Option::output_dir);
+ QString sourceRelativePath = fileFixify(sfn, qmake_getpwd(), Option::output_dir);
sourceRelativePath = Option::fixPathToTargetOS(sourceRelativePath, false);
if (sourceRelativePath.startsWith(".." + Option::dir_sep))
@@ -1522,22 +1575,22 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const
reg_var.setMinimal(true);
for(int rep = 0; (rep = reg_var.indexIn(ret, rep)) != -1; ) {
QStringList val;
- const QString var = ret.mid(rep + 2, reg_var.matchedLength() - 3);
+ const ProString var(ret.mid(rep + 2, reg_var.matchedLength() - 3));
bool filePath = false;
if(val.isEmpty() && var.startsWith(QLatin1String("QMAKE_VAR_"))) {
- const QString varname = var.mid(10);
- val += project->values(varname);
+ const ProKey varname = var.mid(10).toKey();
+ val += project->values(varname).toQStringList();
}
if(val.isEmpty() && var.startsWith(QLatin1String("QMAKE_VAR_FIRST_"))) {
- const QString varname = var.mid(16);
- val += project->first(varname);
+ const ProKey varname = var.mid(16).toKey();
+ val += project->first(varname).toQString();
}
if(val.isEmpty() && !in.isEmpty()) {
if(var.startsWith(QLatin1String("QMAKE_FUNC_FILE_IN_"))) {
filePath = true;
- const QString funcname = var.mid(19);
- val += project->expand(funcname, QList<QStringList>() << in);
+ const ProKey funcname = var.mid(19).toKey();
+ val += project->expand(funcname, QList<ProStringList>() << ProStringList(in));
} else if(var == QLatin1String("QMAKE_FILE_BASE") || var == QLatin1String("QMAKE_FILE_IN_BASE")) {
//filePath = true;
for(int i = 0; i < in.size(); ++i) {
@@ -1574,8 +1627,8 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const
if(val.isEmpty() && !out.isEmpty()) {
if(var.startsWith(QLatin1String("QMAKE_FUNC_FILE_OUT_"))) {
filePath = true;
- const QString funcname = var.mid(20);
- val += project->expand(funcname, QList<QStringList>() << out);
+ const ProKey funcname = var.mid(20).toKey();
+ val += project->expand(funcname, QList<ProStringList>() << ProStringList(out));
} else if(var == QLatin1String("QMAKE_FILE_OUT")) {
filePath = true;
for(int i = 0; i < out.size(); ++i)
@@ -1592,8 +1645,8 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const
}
}
if(val.isEmpty() && var.startsWith(QLatin1String("QMAKE_FUNC_"))) {
- const QString funcname = var.mid(11);
- val += project->expand(funcname, QList<QStringList>() << in << out);
+ const ProKey funcname = var.mid(11).toKey();
+ val += project->expand(funcname, QList<ProStringList>() << ProStringList(in) << ProStringList(out));
}
if(!val.isEmpty()) {
@@ -1621,13 +1674,14 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const
}
bool
-MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_unfixed)
+MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &file_unfixed)
{
if(noIO())
return false;
const QString file = Option::fixPathToLocalOS(file_unfixed);
- if(project->values(comp + ".CONFIG").indexOf("moc_verify") != -1) {
+ const ProStringList &config = project->values(ProKey(comp + ".CONFIG"));
+ if (config.indexOf("moc_verify") != -1) {
if(!file.isNull()) {
QMakeSourceFileInfo::addSourceFile(file, QMakeSourceFileInfo::SEEK_MOCS);
if(!mocable(file)) {
@@ -1636,40 +1690,41 @@ MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_
project->values("MOCABLES").append(file);
}
}
- } else if(project->values(comp + ".CONFIG").indexOf("function_verify") != -1) {
- QString tmp_out = project->values(comp + ".output").first();
+ } else if (config.indexOf("function_verify") != -1) {
+ ProString tmp_out = project->values(ProKey(comp + ".output")).first();
if(tmp_out.isEmpty())
return false;
- QStringList verify_function = project->values(comp + ".verify_function");
+ ProStringList verify_function = project->values(ProKey(comp + ".verify_function"));
if(verify_function.isEmpty())
return false;
for(int i = 0; i < verify_function.size(); ++i) {
bool invert = false;
- QString verify = verify_function.at(i);
+ ProString verify = verify_function.at(i);
if(verify.at(0) == QLatin1Char('!')) {
invert = true;
verify = verify.mid(1);
}
- if(project->values(comp + ".CONFIG").indexOf("combine") != -1) {
- bool pass = project->test(verify, QList<QStringList>() << QStringList(tmp_out) << QStringList(file));
+ if (config.indexOf("combine") != -1) {
+ bool pass = project->test(verify.toKey(), QList<ProStringList>() << ProStringList(tmp_out) << ProStringList(file));
if(invert)
pass = !pass;
if(!pass)
return false;
} else {
- const QStringList &tmp = project->values(comp + ".input");
- for (QStringList::ConstIterator it = tmp.begin(); it != tmp.end(); ++it) {
- const QStringList &inputs = project->values((*it));
- for (QStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
+ const ProStringList &tmp = project->values(ProKey(comp + ".input"));
+ for (ProStringList::ConstIterator it = tmp.begin(); it != tmp.end(); ++it) {
+ const ProStringList &inputs = project->values((*it).toKey());
+ for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
if((*input).isEmpty())
continue;
- QString in = fileFixify(Option::fixPathToTargetOS((*input), false));
+ QString inpf = (*input).toQString();
+ QString in = fileFixify(Option::fixPathToTargetOS(inpf, false));
if(in == file) {
- bool pass = project->test(verify,
- QList<QStringList>() << QStringList(replaceExtraCompilerVariables(tmp_out, (*input), QString())) <<
- QStringList(file));
+ bool pass = project->test(verify.toKey(),
+ QList<ProStringList>() << ProStringList(replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString())) <<
+ ProStringList(file));
if(invert)
pass = !pass;
if(!pass)
@@ -1680,14 +1735,15 @@ MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_
}
}
}
- } else if(project->values(comp + ".CONFIG").indexOf("verify") != -1) {
- QString tmp_out = project->values(comp + ".output").first();
+ } else if (config.indexOf("verify") != -1) {
+ QString tmp_out = project->values(ProKey(comp + ".output")).first().toQString();
if(tmp_out.isEmpty())
return false;
QString tmp_cmd;
- if(!project->isEmpty(comp + ".commands")) {
+ const ProKey ckey(comp + ".commands");
+ if (!project->isEmpty(ckey)) {
int argv0 = -1;
- QStringList cmdline = project->values(comp + ".commands");
+ ProStringList cmdline = project->values(ckey);
for(int i = 0; i < cmdline.count(); ++i) {
if(!cmdline.at(i).contains('=')) {
argv0 = i;
@@ -1695,25 +1751,26 @@ MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_
}
}
if(argv0 != -1) {
- cmdline[argv0] = Option::fixPathToTargetOS(cmdline.at(argv0), false);
+ cmdline[argv0] = Option::fixPathToTargetOS(cmdline.at(argv0).toQString(), false);
tmp_cmd = cmdline.join(" ");
}
}
- if(project->values(comp + ".CONFIG").indexOf("combine") != -1) {
+ if (config.indexOf("combine") != -1) {
QString cmd = replaceExtraCompilerVariables(tmp_cmd, QString(), tmp_out);
if(system(cmd.toLatin1().constData()))
return false;
} else {
- const QStringList &tmp = project->values(comp + ".input");
- for (QStringList::ConstIterator it = tmp.begin(); it != tmp.end(); ++it) {
- const QStringList &inputs = project->values((*it));
- for (QStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
+ const ProStringList &tmp = project->values(ProKey(comp + ".input"));
+ for (ProStringList::ConstIterator it = tmp.begin(); it != tmp.end(); ++it) {
+ const ProStringList &inputs = project->values((*it).toKey());
+ for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
if((*input).isEmpty())
continue;
- QString in = fileFixify(Option::fixPathToTargetOS((*input), false));
+ QString inpf = (*input).toQString();
+ QString in = fileFixify(Option::fixPathToTargetOS(inpf, false));
if(in == file) {
- QString out = replaceExtraCompilerVariables(tmp_out, (*input), QString());
+ QString out = replaceExtraCompilerVariables(tmp_out, inpf, QString());
QString cmd = replaceExtraCompilerVariables(tmp_cmd, in, out);
if(system(cmd.toLatin1().constData()))
return false;
@@ -1729,22 +1786,23 @@ MakefileGenerator::verifyExtraCompiler(const QString &comp, const QString &file_
void
MakefileGenerator::writeExtraTargets(QTextStream &t)
{
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) {
- QString targ = var((*it) + ".target"),
- cmd = var((*it) + ".commands"), deps;
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) {
+ QString targ = var(ProKey(*it + ".target")),
+ cmd = var(ProKey(*it + ".commands")), deps;
if(targ.isEmpty())
- targ = (*it);
- const QStringList &deplist = project->values((*it) + ".depends");
- for (QStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
- QString dep = var((*dep_it) + ".target");
+ targ = (*it).toQString();
+ const ProStringList &deplist = project->values(ProKey(*it + ".depends"));
+ for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
+ QString dep = var(ProKey(*dep_it + ".target"));
if(dep.isEmpty())
- dep = (*dep_it);
+ dep = (*dep_it).toQString();
deps += " " + escapeDependencyPath(dep);
}
- if(project->values((*it) + ".CONFIG").indexOf("fix_target") != -1)
+ const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
+ if (config.indexOf("fix_target") != -1)
targ = fileFixify(targ, Option::output_dir, Option::output_dir);
- if (project->values((*it) + ".CONFIG").indexOf("phony") != -1)
+ if (config.indexOf("phony") != -1)
deps += QLatin1String(" FORCE");
t << escapeDependencyPath(targ) << ":" << deps;
if(!cmd.isEmpty())
@@ -1757,25 +1815,26 @@ void
MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
{
QString clean_targets;
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- QString tmp_out = fileFixify(project->values((*it) + ".output").first(),
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ QString tmp_out = fileFixify(project->first(ProKey(*it + ".output")).toQString(),
Option::output_dir, Option::output_dir);
QString tmp_cmd;
- if(!project->isEmpty((*it) + ".commands")) {
- QStringList cmdline = project->values((*it) + ".commands");
+ const ProKey ckey(*it + ".commands");
+ if (!project->isEmpty(ckey)) {
+ QStringList cmdline = project->values(ckey).toQStringList();
int argv0 = findExecutable(cmdline);
if(argv0 != -1) {
cmdline[argv0] = escapeFilePath(Option::fixPathToTargetOS(cmdline.at(argv0), false));
tmp_cmd = cmdline.join(" ");
}
}
- QStringList tmp_dep = project->values((*it) + ".depends");
QString tmp_dep_cmd;
QString dep_cd_cmd;
- if(!project->isEmpty((*it) + ".depend_command")) {
+ const ProKey dckey(*it + ".depend_command");
+ if (!project->isEmpty(dckey)) {
int argv0 = -1;
- QStringList cmdline = project->values((*it) + ".depend_command");
+ ProStringList cmdline = project->values(dckey);
for(int i = 0; i < cmdline.count(); ++i) {
if(!cmdline.at(i).contains('=')) {
argv0 = i;
@@ -1783,30 +1842,33 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
}
if(argv0 != -1) {
- const QString c = Option::fixPathToLocalOS(cmdline.at(argv0), true);
+ QString arg = cmdline.at(argv0).toQString();
+ const QString c = Option::fixPathToLocalOS(arg, true);
if(exists(c)) {
- cmdline[argv0] = escapeFilePath(Option::fixPathToLocalOS(cmdline.at(argv0), false));
+ arg = escapeFilePath(Option::fixPathToLocalOS(arg, false));
} else {
- cmdline[argv0] = escapeFilePath(cmdline.at(argv0));
+ arg = escapeFilePath(arg);
}
- QFileInfo cmdFileInfo(cmdline[argv0]);
- if (!cmdFileInfo.isAbsolute() || cmdFileInfo.exists())
+ QFileInfo cmdFileInfo(arg);
+ if (!cmdFileInfo.isAbsolute() || cmdFileInfo.exists()) {
+ cmdline[argv0] = arg;
tmp_dep_cmd = cmdline.join(" ");
+ }
}
dep_cd_cmd = QLatin1String("cd ")
+ escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+ QLatin1String(" && ");
}
- const QStringList &vars = project->values((*it) + ".variables");
+ const ProStringList &vars = project->values(ProKey(*it + ".variables"));
if(tmp_out.isEmpty() || tmp_cmd.isEmpty())
continue;
- QStringList tmp_inputs;
+ ProStringList tmp_inputs;
{
- const QStringList &comp_inputs = project->values((*it) + ".input");
- for(QStringList::ConstIterator it2 = comp_inputs.begin(); it2 != comp_inputs.end(); ++it2) {
- const QStringList &tmp = project->values((*it2));
- for(QStringList::ConstIterator input = tmp.begin(); input != tmp.end(); ++input) {
- QString in = Option::fixPathToTargetOS((*input), false);
+ const ProStringList &comp_inputs = project->values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator it2 = comp_inputs.begin(); it2 != comp_inputs.end(); ++it2) {
+ const ProStringList &tmp = project->values((*it2).toKey());
+ for (ProStringList::ConstIterator input = tmp.begin(); input != tmp.end(); ++input) {
+ QString in = Option::fixPathToTargetOS((*input).toQString(), false);
if(verifyExtraCompiler((*it), in))
tmp_inputs.append((*input));
}
@@ -1814,20 +1876,21 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
t << "compiler_" << (*it) << "_make_all:";
- if(project->values((*it) + ".CONFIG").indexOf("combine") != -1) {
+ const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
+ if (config.indexOf("combine") != -1) {
// compilers with a combined input only have one output
- QString input = project->values((*it) + ".output").first();
+ QString input = project->first(ProKey(*it + ".output")).toQString();
t << " " << escapeDependencyPath(replaceExtraCompilerVariables(tmp_out, input, QString()));
} else {
- for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
- t << " " << escapeDependencyPath(replaceExtraCompilerVariables(tmp_out, (*input), QString()));
+ for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
+ t << " " << escapeDependencyPath(replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString()));
}
}
t << endl;
- if(project->values((*it) + ".CONFIG").indexOf("no_clean") == -1) {
- QString tmp_clean = project->values((*it) + ".clean").join(" ");
- QString tmp_clean_cmds = project->values((*it) + ".clean_commands").join(" ");
+ if (config.indexOf("no_clean") == -1) {
+ QString tmp_clean = project->values(ProKey(*it + ".clean")).join(" ");
+ QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(" ");
if(!tmp_inputs.isEmpty())
clean_targets += QString("compiler_" + (*it) + "_clean ");
t << "compiler_" << (*it) << "_clean:";
@@ -1845,19 +1908,22 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
- QStringList cleans;
+ ProStringList cleans;
const QString del_statement("-$(DEL_FILE)");
if(!wrote_clean) {
if(project->isActiveConfig("no_delete_multiple_files")) {
- for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input)
- cleans.append(" " + replaceExtraCompilerVariables(tmp_clean, (*input),
- replaceExtraCompilerVariables(tmp_out, (*input), QString())));
+ for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
+ QString tinp = (*input).toQString();
+ cleans.append(" " + replaceExtraCompilerVariables(tmp_clean, tinp,
+ replaceExtraCompilerVariables(tmp_out, tinp, QString())));
+ }
} else {
QString files, file;
const int commandlineLimit = 2047; // NT limit, expanded
for(int input = 0; input < tmp_inputs.size(); ++input) {
- file = " " + replaceExtraCompilerVariables(tmp_clean, tmp_inputs.at(input),
- replaceExtraCompilerVariables(tmp_out, tmp_inputs.at(input), QString()));
+ QString tinp = tmp_inputs.at(input).toQString();
+ file = " " + replaceExtraCompilerVariables(tmp_clean, tinp,
+ replaceExtraCompilerVariables(tmp_out, tinp, QString()));
if(del_statement.length() + files.length() +
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
cleans.append(files);
@@ -1872,15 +1938,17 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(!cleans.isEmpty())
t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
if(!wrote_clean_cmds) {
- for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
- t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, (*input),
- replaceExtraCompilerVariables(tmp_out, (*input), QString()));
+ for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
+ QString tinp = (*input).toQString();
+ t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, tinp,
+ replaceExtraCompilerVariables(tmp_out, tinp, QString()));
}
}
}
t << endl;
}
- if(project->values((*it) + ".CONFIG").indexOf("combine") != -1) {
+ QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
+ if (config.indexOf("combine") != -1) {
if(tmp_out.indexOf("${QMAKE_") != -1) {
warn_msg(WarnLogic, "QMAKE_EXTRA_COMPILERS(%s) with combine has variable output.",
(*it).toLatin1().constData());
@@ -1889,13 +1957,13 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QStringList deps, inputs;
if(!tmp_dep.isEmpty())
deps += fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
- for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
- deps += findDependencies((*input));
- inputs += Option::fixPathToTargetOS((*input), false);
+ for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
+ QString inpf = (*input).toQString();
+ deps += findDependencies(inpf);
+ inputs += Option::fixPathToTargetOS(inpf, false);
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
- tmp_out);
+ QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out);
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
@@ -1948,7 +2016,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList(tmp_out));
t << escapeDependencyPath(tmp_out) << ":";
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
- if(project->values((*it) + ".CONFIG").indexOf("explicit_dependencies") != -1) {
+ if (config.indexOf("explicit_dependencies") != -1) {
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
@@ -1956,23 +2024,24 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
t << "\n\t" << cmd << endl << endl;
continue;
}
- for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
- QString in = Option::fixPathToTargetOS((*input), false);
- QStringList deps = findDependencies((*input));
+ for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
+ QString inpf = (*input).toQString();
+ QString in = Option::fixPathToTargetOS(inpf, false);
+ QStringList deps = findDependencies(inpf);
deps += escapeDependencyPath(in);
- QString out = replaceExtraCompilerVariables(tmp_out, (*input), QString());
+ QString out = replaceExtraCompilerVariables(tmp_out, inpf, QString());
if(!tmp_dep.isEmpty()) {
QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
for(int i = 0; i < pre_deps.size(); ++i)
- deps += replaceExtraCompilerVariables(pre_deps.at(i), (*input), out);
+ deps += replaceExtraCompilerVariables(pre_deps.at(i), inpf, out);
}
- QString cmd = replaceExtraCompilerVariables(tmp_cmd, (*input), out);
+ QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out);
// NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use!
- for(QStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
+ for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
+ QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out);
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
@@ -2066,16 +2135,16 @@ void
MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
{
bool first = true;
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- const QStringList &vars = project->values((*it) + ".variables");
- for(QStringList::ConstIterator varit = vars.begin(); varit != vars.end(); ++varit) {
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ const ProStringList &vars = project->values(ProKey(*it + ".variables"));
+ for (ProStringList::ConstIterator varit = vars.begin(); varit != vars.end(); ++varit) {
if(first) {
t << "\n####### Custom Compiler Variables" << endl;
first = false;
}
t << "QMAKE_COMP_" << (*varit) << " = "
- << valList(project->values((*varit))) << endl;
+ << valList(project->values((*varit).toKey())) << endl;
}
}
if(!first)
@@ -2087,13 +2156,13 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
{
t << endl;
- QStringList outlist;
- const QHash<QString, QStringList> &vars = project->variables();
- const QStringList &exports = project->values("QMAKE_EXTRA_VARIABLES");
- for (QHash<QString, QStringList>::ConstIterator it = vars.begin(); it != vars.end(); ++it) {
- for (QStringList::ConstIterator exp_it = exports.begin(); exp_it != exports.end(); ++exp_it) {
- QRegExp rx((*exp_it), Qt::CaseInsensitive, QRegExp::Wildcard);
- if (rx.exactMatch(it.key()))
+ ProStringList outlist;
+ const ProValueMap &vars = project->variables();
+ const ProStringList &exports = project->values("QMAKE_EXTRA_VARIABLES");
+ for (ProValueMap::ConstIterator it = vars.begin(); it != vars.end(); ++it) {
+ for (ProStringList::ConstIterator exp_it = exports.begin(); exp_it != exports.end(); ++exp_it) {
+ QRegExp rx((*exp_it).toQString(), Qt::CaseInsensitive, QRegExp::Wildcard);
+ if (rx.exactMatch(it.key().toQString()))
outlist << ("EXPORT_" + it.key() + " = " + it.value().join(" "));
}
}
@@ -2107,8 +2176,8 @@ bool
MakefileGenerator::writeStubMakefile(QTextStream &t)
{
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
//const QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
t << "first all clean install distclean uninstall: " << "qmake" << endl
@@ -2126,7 +2195,7 @@ MakefileGenerator::writeMakefile(QTextStream &t)
writeObj(t, "GENERATED_SOURCES");
t << "####### Install" << endl << endl;
- writeInstalls(t, "INSTALLS");
+ writeInstalls(t);
t << "FORCE:" << endl << endl;
return true;
@@ -2188,30 +2257,33 @@ MakefileGenerator::findSubDirsSubTargets() const
{
QList<SubTarget*> targets;
{
- const QStringList subdirs = project->values("SUBDIRS");
+ const ProStringList &subdirs = project->values("SUBDIRS");
for(int subdir = 0; subdir < subdirs.size(); ++subdir) {
- QString fixedSubdir = subdirs[subdir];
+ ProString ofile = subdirs[subdir];
+ QString oname = ofile.toQString();
+ QString fixedSubdir = oname;
fixedSubdir = fixedSubdir.replace(QRegExp("[^a-zA-Z0-9_]"),"-");
SubTarget *st = new SubTarget;
- st->name = subdirs[subdir];
+ st->name = oname;
targets.append(st);
bool fromFile = false;
- QString file = subdirs[subdir];
- if(!project->isEmpty(fixedSubdir + ".file")) {
- if(!project->isEmpty(fixedSubdir + ".subdir"))
+ const ProKey fkey(fixedSubdir + ".file");
+ const ProKey skey(fixedSubdir + ".subdir");
+ if (!project->isEmpty(fkey)) {
+ if (!project->isEmpty(skey))
warn_msg(WarnLogic, "Cannot assign both file and subdir for subdir %s",
subdirs[subdir].toLatin1().constData());
- file = project->first(fixedSubdir + ".file");
+ ofile = project->first(fkey);
fromFile = true;
- } else if(!project->isEmpty(fixedSubdir + ".subdir")) {
- file = project->first(fixedSubdir + ".subdir");
+ } else if (!project->isEmpty(skey)) {
+ ofile = project->first(skey);
fromFile = false;
} else {
- fromFile = file.endsWith(Option::pro_ext);
+ fromFile = ofile.endsWith(Option::pro_ext);
}
- file = Option::fixPathToTargetOS(file);
+ QString file = Option::fixPathToTargetOS(ofile.toQString());
if(fromFile) {
int slsh = file.lastIndexOf(Option::dir_sep);
@@ -2232,8 +2304,9 @@ MakefileGenerator::findSubDirsSubTargets() const
st->out_directory = st->in_directory;
else
st->out_directory = fileFixify(st->in_directory, qmake_getpwd(), Option::output_dir);
- if(!project->isEmpty(fixedSubdir + ".makefile")) {
- st->makefile = project->first(fixedSubdir + ".makefile");
+ const ProKey mkey(fixedSubdir + ".makefile");
+ if (!project->isEmpty(mkey)) {
+ st->makefile = project->first(mkey).toQString();
} else {
st->makefile = "Makefile";
if(!st->profile.isEmpty()) {
@@ -2245,22 +2318,29 @@ MakefileGenerator::findSubDirsSubTargets() const
st->makefile += "." + st->profile.left(st->profile.length() - Option::pro_ext.length());
}
}
- if(!project->isEmpty(fixedSubdir + ".depends")) {
- const QStringList depends = project->values(fixedSubdir + ".depends");
+ const ProKey dkey(fixedSubdir + ".depends");
+ if (!project->isEmpty(dkey)) {
+ const ProStringList &depends = project->values(dkey);
for(int depend = 0; depend < depends.size(); ++depend) {
bool found = false;
for(int subDep = 0; subDep < subdirs.size(); ++subDep) {
if(subdirs[subDep] == depends.at(depend)) {
- QString fixedSubDep = subdirs[subDep];
+ QString subName = subdirs[subDep].toQString();
+ QString fixedSubDep = subName;
fixedSubDep = fixedSubDep.replace(QRegExp("[^a-zA-Z0-9_]"),"-");
- if(!project->isEmpty(fixedSubDep + ".target")) {
- st->depends += project->first(fixedSubDep + ".target");
+ const ProKey dtkey(fixedSubDep + ".target");
+ if (!project->isEmpty(dtkey)) {
+ st->depends += project->first(dtkey);
} else {
- QString d = Option::fixPathToLocalOS(subdirs[subDep]);
- if(!project->isEmpty(fixedSubDep + ".file"))
- d = project->first(fixedSubDep + ".file");
- else if(!project->isEmpty(fixedSubDep + ".subdir"))
- d = project->first(fixedSubDep + ".subdir");
+ QString d = Option::fixPathToLocalOS(subName);
+ const ProKey dfkey(fixedSubDep + ".file");
+ if (!project->isEmpty(dfkey)) {
+ d = project->first(dfkey).toQString();
+ } else {
+ const ProKey dskey(fixedSubDep + ".subdir");
+ if (!project->isEmpty(dskey))
+ d = project->first(dskey).toQString();
+ }
st->depends += "sub-" + d.replace(QRegExp("[^a-zA-Z0-9_]"),"-");
}
found = true;
@@ -2268,13 +2348,14 @@ MakefileGenerator::findSubDirsSubTargets() const
}
}
if(!found) {
- QString depend_str = depends.at(depend);
+ QString depend_str = depends.at(depend).toQString();
st->depends += depend_str.replace(QRegExp("[^a-zA-Z0-9_]"),"-");
}
}
}
- if(!project->isEmpty(fixedSubdir + ".target")) {
- st->target = project->first(fixedSubdir + ".target");
+ const ProKey tkey(fixedSubdir + ".target");
+ if (!project->isEmpty(tkey)) {
+ st->target = project->first(tkey).toQString();
} else {
st->target = "sub-" + file;
st->target = st->target.replace(QRegExp("[^a-zA-Z0-9_]"),"-");
@@ -2322,8 +2403,8 @@ void
MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubTarget*> targets, int flags)
{
// blasted includes
- const QStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
- for (QStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
+ const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
+ for (ProStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
t << "include " << (*qeui_it) << endl;
if (!(flags & SubTargetSkipDefaultVariables)) {
@@ -2355,7 +2436,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
writeExtraVariables(t);
QStringList targetSuffixes;
- const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH");
+ const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
if (!(flags & SubTargetSkipDefaultTargets)) {
targetSuffixes << "make_first" << "all" << "clean" << "distclean"
<< QString((flags & SubTargetInstalls) ? "install_subtargets" : "install")
@@ -2466,12 +2547,13 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
t << suffix << ":";
for(int target = 0; target < targets.size(); ++target) {
SubTarget *subTarget = targets.at(target);
+ const ProStringList &config = project->values(ProKey(subTarget->name + ".CONFIG"));
if (suffix == "make_first"
- && project->values(subTarget->name + ".CONFIG").indexOf("no_default_target") != -1) {
+ && config.indexOf("no_default_target") != -1) {
continue;
}
if((suffix == "install_subtargets" || suffix == "uninstall_subtargets")
- && project->values(subTarget->name + ".CONFIG").indexOf("no_default_install") != -1) {
+ && config.indexOf("no_default_install") != -1) {
continue;
}
QString targetRule = subTarget->target + "-" + suffix;
@@ -2495,25 +2577,27 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
}
// user defined targets
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (QStringList::ConstIterator qut_it = qut.begin(); qut_it != qut.end(); ++qut_it) {
- QString targ = var((*qut_it) + ".target"),
- cmd = var((*qut_it) + ".commands"), deps;
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator qut_it = qut.begin(); qut_it != qut.end(); ++qut_it) {
+ const ProStringList &config = project->values(ProKey(*qut_it + ".CONFIG"));
+ QString targ = var(ProKey(*qut_it + ".target")),
+ cmd = var(ProKey(*qut_it + ".commands")), deps;
if(targ.isEmpty())
- targ = (*qut_it);
+ targ = (*qut_it).toQString();
t << endl;
- const QStringList &deplist = project->values((*qut_it) + ".depends");
- for (QStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
- QString dep = var((*dep_it) + ".target");
+ const ProStringList &deplist = project->values(ProKey(*qut_it + ".depends"));
+ for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
+ QString dep = var(ProKey(*dep_it + ".target"));
if(dep.isEmpty())
- dep = Option::fixPathToTargetOS(*dep_it, false);
+ dep = Option::fixPathToTargetOS((*dep_it).toQString(), false);
deps += " " + dep;
}
- if(project->values((*qut_it) + ".CONFIG").indexOf("recursive") != -1) {
+ if (config.indexOf("recursive") != -1) {
QSet<QString> recurse;
- if(project->isSet((*qut_it) + ".recurse")) {
- recurse = project->values((*qut_it) + ".recurse").toSet();
+ const ProKey rkey(*qut_it + ".recurse");
+ if (project->isSet(rkey)) {
+ recurse = project->values(rkey).toQStringList().toSet();
} else {
for(int target = 0; target < targets.size(); ++target)
recurse.insert(targets.at(target)->name);
@@ -2561,15 +2645,16 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
}
QString sub_targ = targ;
- if(project->isSet((*qut_it) + ".recurse_target"))
- sub_targ = project->first((*qut_it) + ".recurse_target");
+ const ProKey rtkey(*qut_it + ".recurse_target");
+ if (project->isSet(rtkey))
+ sub_targ = project->first(rtkey).toQString();
//write the commands
writeSubTargetCall(t, in_directory, in, out_directory, out,
out_directory_cdin, makefilein + " " + sub_targ);
}
}
- if (project->values((*qut_it) + ".CONFIG").indexOf("phony") != -1)
+ if (config.indexOf("phony") != -1)
deps += " FORCE";
t << targ << ":" << deps << "\n";
if(!cmd.isEmpty())
@@ -2579,7 +2664,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(flags & SubTargetInstalls) {
project->values("INSTALLDEPS") += "install_subtargets";
project->values("UNINSTALLDEPS") += "uninstall_subtargets";
- writeInstalls(t, "INSTALLS", true);
+ writeInstalls(t, true);
}
t << "FORCE:" << endl << endl;
}
@@ -2590,7 +2675,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
QStringList files = fileFixify(Option::mkfile::project_files);
- t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE")) << ": " << "\n\t"
+ t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": " << "\n\t"
<< "@$(QMAKE) -prl " << buildArgs() << " " << files.join(" ") << endl;
}
@@ -2608,11 +2693,11 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf")))
t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " ";
}
- const QStringList &included = project->values("QMAKE_INTERNAL_INCLUDED_FILES");
+ const ProStringList &included = project->values("QMAKE_INTERNAL_INCLUDED_FILES");
t << escapeDependencyPaths(included).join(" \\\n\t\t") << "\n\t"
<< qmake << endl;
for(int include = 0; include < included.size(); ++include) {
- const QString i(included.at(include));
+ const ProString &i = included.at(include);
if(!i.isEmpty())
t << i << ":" << endl;
}
@@ -2657,6 +2742,18 @@ MakefileGenerator::unescapeFilePath(const QString &path) const
return ret;
}
+ProString
+MakefileGenerator::unescapeFilePath(const ProString &path) const
+{
+ return ProString(unescapeFilePath(path.toQString()));
+}
+
+ProString
+MakefileGenerator::escapeFilePath(const ProString &path) const
+{
+ return ProString(escapeFilePath(path.toQString()));
+}
+
QStringList
MakefileGenerator::escapeFilePaths(const QStringList &paths) const
{
@@ -2666,6 +2763,15 @@ MakefileGenerator::escapeFilePaths(const QStringList &paths) const
return ret;
}
+ProStringList
+MakefileGenerator::escapeFilePaths(const ProStringList &paths) const
+{
+ ProStringList ret;
+ for (int i = 0; i < paths.size(); ++i)
+ ret.append(escapeFilePath(paths.at(i)));
+ return ret;
+}
+
QStringList
MakefileGenerator::escapeDependencyPaths(const QStringList &paths) const
{
@@ -2675,6 +2781,15 @@ MakefileGenerator::escapeDependencyPaths(const QStringList &paths) const
return ret;
}
+ProStringList
+MakefileGenerator::escapeDependencyPaths(const ProStringList &paths) const
+{
+ ProStringList ret;
+ for (int i = 0; i < paths.size(); ++i)
+ ret.append(escapeDependencyPath(paths.at(i).toQString()));
+ return ret;
+}
+
QStringList
MakefileGenerator::unescapeFilePaths(const QStringList &paths) const
{
@@ -2684,6 +2799,15 @@ MakefileGenerator::unescapeFilePaths(const QStringList &paths) const
return ret;
}
+ProStringList
+MakefileGenerator::unescapeFilePaths(const ProStringList &paths) const
+{
+ ProStringList ret;
+ for (int i = 0; i < paths.size(); ++i)
+ ret.append(unescapeFilePath(paths.at(i)));
+ return ret;
+}
+
QStringList
MakefileGenerator::fileFixify(const QStringList& files, const QString &out_dir, const QString &in_dir,
FileFixifyType fix, bool canon) const
@@ -2815,10 +2939,10 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
QMakeLocalFileName ret;
if(!project->isEmpty("SKIP_DEPENDS")) {
bool found = false;
- const QStringList &nodeplist = project->values("SKIP_DEPENDS");
- for (QStringList::ConstIterator it = nodeplist.begin();
+ const ProStringList &nodeplist = project->values("SKIP_DEPENDS");
+ for (ProStringList::ConstIterator it = nodeplist.begin();
it != nodeplist.end(); ++it) {
- QRegExp regx((*it));
+ QRegExp regx((*it).toQString());
if(regx.indexIn(dep.local()) != -1) {
found = true;
break;
@@ -2864,11 +2988,11 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
}
{ //is it from an EXTRA_TARGET
const QString dep_basename = dep.local().section(Option::dir_sep, -1);
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) {
- QString targ = var((*it) + ".target");
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) {
+ QString targ = var(ProKey(*it + ".target"));
if(targ.isEmpty())
- targ = (*it);
+ targ = (*it).toQString();
QString out = Option::fixPathToTargetOS(targ);
if(out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) {
ret = QMakeLocalFileName(out);
@@ -2878,17 +3002,18 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
}
{ //is it from an EXTRA_COMPILER
const QString dep_basename = dep.local().section(Option::dir_sep, -1);
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- QString tmp_out = project->values((*it) + ".output").first();
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ const ProString &tmp_out = project->first(ProKey(*it + ".output"));
if(tmp_out.isEmpty())
continue;
- const QStringList &tmp = project->values((*it) + ".input");
- for (QStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
- const QStringList &inputs = project->values((*it2));
- for (QStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
- QString out = Option::fixPathToTargetOS(unescapeFilePath(replaceExtraCompilerVariables(tmp_out, (*input), QString())));
- if(out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) {
+ const ProStringList &tmp = project->values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
+ const ProStringList &inputs = project->values((*it2).toKey());
+ for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
+ QString out = Option::fixPathToTargetOS(unescapeFilePath(
+ replaceExtraCompilerVariables(tmp_out.toQString(), (*input).toQString(), QString())));
+ if (out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) {
ret = QMakeLocalFileName(fileFixify(out, qmake_getpwd(), Option::output_dir));
goto found_dep_from_heuristic;
}
@@ -2942,7 +3067,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
if(!outdir.isEmpty() || file.fileName().isEmpty()) {
QString fname = "Makefile";
if(!project->isEmpty("MAKEFILE"))
- fname = project->first("MAKEFILE");
+ fname = project->first("MAKEFILE").toQString();
file.setFileName(outdir + fname);
}
}
@@ -2993,7 +3118,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
if(dot != -1)
ret = ret.left(dot);
ret += Option::pkgcfg_ext;
- QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR");
+ QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR").toQString();
if(!subdir.isEmpty()) {
// initOutPaths() appends dir_sep, but just to be safe..
if (!subdir.endsWith(Option::dir_sep))
@@ -3002,7 +3127,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
}
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
- ret.prepend(project->first("DESTDIR"));
+ ret.prepend(project->first("DESTDIR").toQString());
ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir));
}
return ret;
@@ -3012,7 +3137,7 @@ QString
MakefileGenerator::pkgConfigPrefix() const
{
if(!project->isEmpty("QMAKE_PKGCONFIG_PREFIX"))
- return project->first("QMAKE_PKGCONFIG_PREFIX");
+ return project->first("QMAKE_PKGCONFIG_PREFIX").toQString();
return QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath, QLibraryInfo::FinalPaths);
}
@@ -3040,10 +3165,10 @@ MakefileGenerator::writePkgConfigFile()
QTextStream t(&ft);
QString prefix = pkgConfigPrefix();
- QString libDir = project->first("QMAKE_PKGCONFIG_LIBDIR");
+ QString libDir = project->first("QMAKE_PKGCONFIG_LIBDIR").toQString();
if(libDir.isEmpty())
libDir = prefix + Option::dir_sep + "lib" + Option::dir_sep;
- QString includeDir = project->first("QMAKE_PKGCONFIG_INCDIR");
+ QString includeDir = project->first("QMAKE_PKGCONFIG_INCDIR").toQString();
if(includeDir.isEmpty())
includeDir = prefix + "/include";
@@ -3054,20 +3179,20 @@ MakefileGenerator::writePkgConfigFile()
t << endl;
//extra PKGCONFIG variables
- const QStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES");
+ const ProStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES");
for(int i = 0; i < pkgconfig_vars.size(); ++i) {
- QString var = project->first(pkgconfig_vars.at(i) + ".name"),
- val = project->values(pkgconfig_vars.at(i) + ".value").join(" ");
+ const ProString &var = project->first(ProKey(pkgconfig_vars.at(i) + ".name"));
+ QString val = project->values(ProKey(pkgconfig_vars.at(i) + ".value")).join(" ");
if(var.isEmpty())
continue;
if(val.isEmpty()) {
- const QStringList &var_vars = project->values(pkgconfig_vars.at(i) + ".variable");
+ const ProStringList &var_vars = project->values(ProKey(pkgconfig_vars.at(i) + ".variable"));
for(int v = 0; v < var_vars.size(); ++v) {
- const QStringList &vars = project->values(var_vars.at(v));
+ const ProStringList &vars = project->values(var_vars.at(v).toKey());
for(int var = 0; var < vars.size(); ++var) {
if(!val.isEmpty())
val += " ";
- val += pkgConfigFixPath(vars.at(var));
+ val += pkgConfigFixPath(vars.at(var).toQString());
}
}
}
@@ -3076,16 +3201,16 @@ MakefileGenerator::writePkgConfigFile()
t << endl;
- QString name = project->first("QMAKE_PKGCONFIG_NAME");
+ QString name = project->first("QMAKE_PKGCONFIG_NAME").toQString();
if(name.isEmpty()) {
- name = project->first("QMAKE_ORIG_TARGET").toLower();
+ name = project->first("QMAKE_ORIG_TARGET").toQString().toLower();
name.replace(0, 1, name[0].toUpper());
}
t << "Name: " << name << endl;
QString desc = project->values("QMAKE_PKGCONFIG_DESCRIPTION").join(" ");
if(desc.isEmpty()) {
if(name.isEmpty()) {
- desc = project->first("QMAKE_ORIG_TARGET").toLower();
+ desc = project->first("QMAKE_ORIG_TARGET").toQString().toLower();
desc.replace(0, 1, desc[0].toUpper());
} else {
desc = name;
@@ -3108,7 +3233,7 @@ MakefileGenerator::writePkgConfigFile()
QString pkgConfiglibName;
if (target_mode == TARG_MACX_MODE && project->isActiveConfig("lib_bundle")) {
pkgConfiglibDir = "-F${libdir}";
- QString bundle;
+ ProString bundle;
if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))
bundle = unescapeFilePath(project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"));
else
@@ -3121,11 +3246,11 @@ MakefileGenerator::writePkgConfigFile()
pkgConfiglibDir = "-L${libdir}";
pkgConfiglibName = "-l" + lname.left(lname.length()-Option::libtool_ext.length());
if (project->isActiveConfig("shared"))
- pkgConfiglibName += project->first("TARGET_VERSION_EXT");
+ pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
}
t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl;
- QStringList libs;
+ ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
libs = project->values("QMAKE_INTERNAL_PRL_LIBS");
} else {
@@ -3134,8 +3259,8 @@ MakefileGenerator::writePkgConfigFile()
libs << "QMAKE_LIBS_PRIVATE";
libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread?
t << "Libs.private: ";
- for(QStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) {
- t << project->values((*it)).join(" ") << " ";
+ for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) {
+ t << project->values((*it).toKey()).join(" ") << " ";
}
t << endl;
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index f801bbce33..90e0222d88 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -92,11 +92,11 @@ class MakefileGenerator : protected QMakeSourceFileInfo
protected:
enum TARG_MODE { TARG_UNIX_MODE, TARG_MACX_MODE, TARG_WIN_MODE } target_mode;
- QStringList createObjectList(const QStringList &sources);
+ ProStringList createObjectList(const ProStringList &sources);
//makefile style generator functions
void writeObj(QTextStream &, const char *src);
- void writeInstalls(QTextStream &t, const QString &installs, bool noBuild=false);
+ void writeInstalls(QTextStream &t, bool noBuild=false);
void writeHeader(QTextStream &t);
void writeSubDirs(QTextStream &t);
void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false);
@@ -118,7 +118,7 @@ protected:
QString name;
QString in_directory, out_directory;
QString profile, target, makefile;
- QStringList depends;
+ ProStringList depends;
};
enum SubTargetFlags {
SubTargetInstalls=0x01,
@@ -137,7 +137,7 @@ protected:
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
//extra compiler interface
- bool verifyExtraCompiler(const QString &c, const QString &f);
+ bool verifyExtraCompiler(const ProString &c, const QString &f);
virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &);
inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out)
{ return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out)); }
@@ -150,11 +150,16 @@ protected:
//escape
virtual QString unescapeFilePath(const QString &path) const;
+ ProString unescapeFilePath(const ProString &path) const;
virtual QStringList unescapeFilePaths(const QStringList &path) const;
+ ProStringList unescapeFilePaths(const ProStringList &path) const;
virtual QString escapeFilePath(const QString &path) const { return path; }
- virtual QString escapeDependencyPath(const QString &path) const { return escapeFilePath(path); }
+ ProString escapeFilePath(const ProString &path) const;
QStringList escapeFilePaths(const QStringList &paths) const;
+ ProStringList escapeFilePaths(const ProStringList &paths) const;
+ virtual QString escapeDependencyPath(const QString &path) const { return escapeFilePath(path); }
QStringList escapeDependencyPaths(const QStringList &paths) const;
+ ProStringList escapeDependencyPaths(const ProStringList &paths) const;
//initialization
void verifyCompilers();
@@ -179,7 +184,7 @@ protected:
VPATH_RemoveMissingFiles = 0x02,
VPATH_NoFixify = 0x04
};
- QStringList findFilesInVPATH(QStringList l, uchar flags, const QString &var="");
+ ProStringList findFilesInVPATH(ProStringList l, uchar flags, const QString &var="");
inline int findExecutable(const QStringList &cmdline)
{ int ret; canExecute(cmdline, &ret); return ret; }
@@ -219,13 +224,16 @@ protected:
virtual bool findLibraries();
//for retrieving values and lists of values
- virtual QString var(const QString &var);
- QString varGlue(const QString &var, const QString &before, const QString &glue, const QString &after);
- QString fileVarGlue(const QString &var, const QString &before, const QString &glue, const QString &after);
- QString varList(const QString &var);
+ virtual QString var(const ProKey &var);
+ QString varGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after);
+ QString fileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after);
+ QString varList(const ProKey &var);
+ QString val(const ProStringList &varList);
QString val(const QStringList &varList);
QString valGlue(const QStringList &varList, const QString &before, const QString &glue, const QString &after);
+ QString valGlue(const ProStringList &varList, const QString &before, const QString &glue, const QString &after);
QString valList(const QStringList &varList);
+ QString valList(const ProStringList &varList);
QString filePrefixRoot(const QString &, const QString &);
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 642dd97e68..c4f1ed583a 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -306,11 +306,11 @@ void QMakeSourceFileInfo::setCacheFile(const QString &cf)
loadCache(cachefile);
}
-void QMakeSourceFileInfo::addSourceFiles(const QStringList &l, uchar seek,
+void QMakeSourceFileInfo::addSourceFiles(const ProStringList &l, uchar seek,
QMakeSourceFileInfo::SourceFileType type)
{
for(int i=0; i<l.size(); ++i)
- addSourceFile(l.at(i), seek, type);
+ addSourceFile(l.at(i).toQString(), seek, type);
}
void QMakeSourceFileInfo::addSourceFile(const QString &f, uchar seek,
QMakeSourceFileInfo::SourceFileType type)
diff --git a/qmake/generators/makefiledeps.h b/qmake/generators/makefiledeps.h
index 55a776c84f..7602b5ef4e 100644
--- a/qmake/generators/makefiledeps.h
+++ b/qmake/generators/makefiledeps.h
@@ -42,6 +42,8 @@
#ifndef MAKEFILEDEPS_H
#define MAKEFILEDEPS_H
+#include <proitems.h>
+
#include <qstringlist.h>
#include <qfileinfo.h>
@@ -108,7 +110,7 @@ public:
enum SourceFileType { TYPE_UNKNOWN, TYPE_C, TYPE_UI, TYPE_QRC };
enum SourceFileSeek { SEEK_DEPS=0x01, SEEK_MOCS=0x02 };
- void addSourceFiles(const QStringList &, uchar seek, SourceFileType type=TYPE_C);
+ void addSourceFiles(const ProStringList &, uchar seek, SourceFileType type=TYPE_C);
void addSourceFile(const QString &, uchar seek, SourceFileType type=TYPE_C);
bool containsSourceFile(const QString &, SourceFileType type=TYPE_C);
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index cdb287a65d..c1e7efd62c 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -70,7 +70,7 @@ private:
};
QList<Build *> makefiles;
void clearBuilds();
- MakefileGenerator *processBuild(const QString &);
+ MakefileGenerator *processBuild(const ProString &);
public:
@@ -104,7 +104,7 @@ BuildsMetaMakefileGenerator::init()
return false;
init_flag = true;
- const QStringList &builds = project->values("BUILDS");
+ const ProStringList &builds = project->values("BUILDS");
bool use_single_build = builds.isEmpty();
if(builds.count() > 1 && Option::output.fileName() == "-") {
use_single_build = true;
@@ -115,7 +115,7 @@ BuildsMetaMakefileGenerator::init()
}
if(!use_single_build) {
for(int i = 0; i < builds.count(); i++) {
- QString build = builds[i];
+ ProString build = builds[i];
MakefileGenerator *makefile = processBuild(build);
if(!makefile)
return false;
@@ -128,7 +128,7 @@ BuildsMetaMakefileGenerator::init()
Build *b = new Build;
b->name = name;
if(builds.count() != 1)
- b->build += build;
+ b->build = build.toQString();
b->makefile = makefile;
makefiles += b;
}
@@ -180,7 +180,7 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd)
} else {
if(Option::output.fileName().isEmpty() &&
Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE)
- Option::output.setFileName(project->first("QMAKE_MAKEFILE"));
+ Option::output.setFileName(project->first("QMAKE_MAKEFILE").toQString());
Option::output_dir = oldpwd;
QString build_name = build->name;
if(!build->build.isEmpty()) {
@@ -219,22 +219,20 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd)
}
MakefileGenerator
-*BuildsMetaMakefileGenerator::processBuild(const QString &build)
+*BuildsMetaMakefileGenerator::processBuild(const ProString &build)
{
if(project) {
debug_msg(1, "Meta Generator: Parsing '%s' for build [%s].",
project->projectFile().toLatin1().constData(),build.toLatin1().constData());
//initialize the base
- QHash<QString, QStringList> basevars;
- QStringList basecfgs;
- if(!project->isEmpty(build + ".CONFIG"))
- basecfgs = project->values(build + ".CONFIG");
+ ProValueMap basevars;
+ ProStringList basecfgs = project->values(ProKey(build + ".CONFIG"));
basecfgs += build;
basecfgs += "build_pass";
- basevars["BUILD_PASS"] = QStringList(build);
- QStringList buildname = project->values(build + ".name");
- basevars["BUILD_NAME"] = (buildname.isEmpty() ? QStringList(build) : buildname);
+ basevars["BUILD_PASS"] = ProStringList(build);
+ ProStringList buildname = project->values(ProKey(build + ".name"));
+ basevars["BUILD_NAME"] = (buildname.isEmpty() ? ProStringList(build) : buildname);
//create project
QMakeProject *build_proj = new QMakeProject(project->properties());
@@ -291,18 +289,22 @@ SubdirsMetaMakefileGenerator::init()
QString thispwd = oldpwd;
if(!thispwd.endsWith('/'))
thispwd += '/';
- const QStringList &subdirs = project->values("SUBDIRS");
+ const ProStringList &subdirs = project->values("SUBDIRS");
static int recurseDepth = -1;
++recurseDepth;
for(int i = 0; i < subdirs.size(); ++i) {
Subdir *sub = new Subdir;
sub->indent = recurseDepth;
- QFileInfo subdir(subdirs.at(i));
- if(!project->isEmpty(subdirs.at(i) + ".file"))
- subdir = project->first(subdirs.at(i) + ".file");
- else if(!project->isEmpty(subdirs.at(i) + ".subdir"))
- subdir = project->first(subdirs.at(i) + ".subdir");
+ QFileInfo subdir(subdirs.at(i).toQString());
+ const ProKey fkey(subdirs.at(i) + ".file");
+ if (!project->isEmpty(fkey)) {
+ subdir = project->first(fkey).toQString();
+ } else {
+ const ProKey skey(subdirs.at(i) + ".subdir");
+ if (!project->isEmpty(skey))
+ subdir = project->first(skey).toQString();
+ }
QString sub_name;
if(subdir.isDir())
subdir = QFileInfo(subdir.filePath() + "/" + subdir.fileName() + Option::pro_ext);
@@ -439,7 +441,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
return mkfile;
}
- QString gen = proj->first("MAKEFILE_GENERATOR");
+ ProString gen = proj->first("MAKEFILE_GENERATOR");
if(gen.isEmpty()) {
fprintf(stderr, "MAKEFILE_GENERATOR variable not set as a result of parsing : %s. Possibly qmake was not able to find files included using \"include(..)\" - enable qmake debugging to investigate more.\n",
proj->projectFile().toLatin1().constData());
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index dccfc32aea..aefa5ac6aa 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -80,7 +80,7 @@ ProjectGenerator::init()
project->values("CONFIG").clear();
Option::postProcessProject(project);
- QHash<QString, QStringList> &v = project->variables();
+ ProValueMap &v = project->variables();
QString templ = Option::user_template.isEmpty() ? QString("app") : Option::user_template;
if(!Option::user_template_prefix.isEmpty())
templ.prepend(Option::user_template_prefix);
@@ -169,7 +169,7 @@ ProjectGenerator::init()
QFileInfo fi(fileInfo(newdir));
if(fi.isDir()) {
newdir = fileFixify(newdir);
- QStringList &subdirs = v["SUBDIRS"];
+ ProStringList &subdirs = v["SUBDIRS"];
if(exists(fi.filePath() + QDir::separator() + fi.fileName() + Option::pro_ext) &&
!subdirs.contains(newdir, Qt::CaseInsensitive)) {
subdirs.append(newdir);
@@ -205,7 +205,7 @@ ProjectGenerator::init()
regx = regx.right(regx.length() - (s+1));
}
QStringList files = QDir(dir).entryList(QDir::nameFiltersFromString(regx), QDir::Dirs);
- QStringList &subdirs = v["SUBDIRS"];
+ ProStringList &subdirs = v["SUBDIRS"];
for(int i = 0; i < (int)files.count(); i++) {
QString newdir(dir + files[i]);
QFileInfo fi(fileInfo(newdir));
@@ -231,28 +231,28 @@ ProjectGenerator::init()
}
}
}
- v["TEMPLATE_ASSIGN"] = QStringList("subdirs");
+ v["TEMPLATE_ASSIGN"] = ProStringList("subdirs");
return;
}
//setup deplist
QList<QMakeLocalFileName> deplist;
{
- const QStringList &d = v["DEPENDPATH"];
+ const ProStringList &d = v["DEPENDPATH"];
for(int i = 0; i < d.size(); ++i)
- deplist.append(QMakeLocalFileName(d[i]));
+ deplist.append(QMakeLocalFileName(d[i].toQString()));
}
setDependencyPaths(deplist);
- QStringList &h = v["HEADERS"];
+ ProStringList &h = v["HEADERS"];
bool no_qt_files = true;
static const char *srcs[] = { "SOURCES", "YACCSOURCES", "LEXSOURCES", "FORMS", 0 };
for (int i = 0; srcs[i]; i++) {
- const QStringList &l = v[srcs[i]];
+ const ProStringList &l = v[srcs[i]];
QMakeSourceFileInfo::SourceFileType type = QMakeSourceFileInfo::TYPE_C;
QMakeSourceFileInfo::addSourceFiles(l, QMakeSourceFileInfo::SEEK_DEPS, type);
for(int i = 0; i < l.size(); ++i) {
- QStringList tmp = QMakeSourceFileInfo::dependencies(l[i]);
+ QStringList tmp = QMakeSourceFileInfo::dependencies(l.at(i).toQString());
if(!tmp.isEmpty()) {
for(int dep_it = 0; dep_it < tmp.size(); ++dep_it) {
QString dep = tmp[dep_it];
@@ -280,7 +280,7 @@ ProjectGenerator::init()
QString src(dep.left(dep.length() - h_ext.length()) +
Option::cpp_ext.at(cppit));
if(exists(src)) {
- QStringList &srcl = v["SOURCES"];
+ ProStringList &srcl = v["SOURCES"];
if(!srcl.contains(src, Qt::CaseInsensitive))
srcl.append(src);
}
@@ -297,16 +297,16 @@ ProjectGenerator::init()
}
//strip out files that are actually output from internal compilers (ie temporary files)
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- QString tmp_out = project->first((*it) + ".output");
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ QString tmp_out = project->first(ProKey(*it + ".output")).toQString();
if(tmp_out.isEmpty())
continue;
- QStringList var_out = project->values((*it) + ".variable_out");
+ ProStringList var_out = project->values(ProKey(*it + ".variable_out"));
bool defaults = var_out.isEmpty();
for(int i = 0; i < var_out.size(); ++i) {
- QString v = var_out.at(i);
+ ProString v = var_out.at(i);
if(v.startsWith("GENERATED_")) {
defaults = true;
break;
@@ -317,15 +317,15 @@ ProjectGenerator::init()
var_out << "HEADERS";
var_out << "FORMS";
}
- const QStringList &tmp = project->values((*it) + ".input");
- for(QStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
- QStringList &inputs = project->values(*it2);
- for(QStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
- QString path = replaceExtraCompilerVariables(tmp_out, (*input), QString());
+ const ProStringList &tmp = project->values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
+ ProStringList &inputs = project->values((*it2).toKey());
+ for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
+ QString path = replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString());
path = fixPathToQmake(path).section('/', -1);
for(int i = 0; i < var_out.size(); ++i) {
- QString v = var_out.at(i);
- QStringList &list = project->values(v);
+ ProString v = var_out.at(i);
+ ProStringList &list = project->values(v.toKey());
for(int src = 0; src < list.size(); ) {
if(list[src] == path || list[src].endsWith("/" + path))
list.removeAt(src);
@@ -356,7 +356,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
QString ofn = QFileInfo(static_cast<QFile *>(t.device())->fileName()).completeBaseName();
if (ofn.isEmpty() || ofn == "-")
ofn = "unknown";
- project->values("TARGET_ASSIGN") = QStringList(ofn);
+ project->values("TARGET_ASSIGN") = ProStringList(ofn);
t << getWritableVar("TARGET_ASSIGN")
<< getWritableVar("CONFIG", false)
@@ -381,7 +381,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
bool
ProjectGenerator::addConfig(const QString &cfg, bool add)
{
- QString where = "CONFIG";
+ ProKey where = "CONFIG";
if(!add)
where = "CONFIG_REMOVE";
if (!project->values(where).contains(cfg)) {
@@ -402,7 +402,7 @@ ProjectGenerator::addFile(QString file)
if(file.mid(dir.length(), Option::h_moc_mod.length()) == Option::h_moc_mod)
return false;
- QString where;
+ ProKey where;
for(int cppit = 0; cppit < Option::cpp_ext.size(); ++cppit) {
if(file.endsWith(Option::cpp_ext[cppit])) {
where = "SOURCES";
@@ -439,7 +439,7 @@ ProjectGenerator::addFile(QString file)
QString newfile = fixPathToQmake(fileFixify(file));
- QStringList &endList = project->values(where);
+ ProStringList &endList = project->values(where);
if(!endList.contains(newfile, Qt::CaseInsensitive)) {
endList += newfile;
return true;
@@ -448,16 +448,17 @@ ProjectGenerator::addFile(QString file)
}
QString
-ProjectGenerator::getWritableVar(const QString &v, bool)
+ProjectGenerator::getWritableVar(const char *vk, bool)
{
- QStringList &vals = project->values(v);
+ const ProKey v(vk);
+ ProStringList &vals = project->values(v);
if(vals.isEmpty())
return "";
// If values contain spaces, ensure that they are quoted
- for(QStringList::iterator it = vals.begin(); it != vals.end(); ++it) {
+ for (ProStringList::iterator it = vals.begin(); it != vals.end(); ++it) {
if ((*it).contains(' ') && !(*it).startsWith(' '))
- *it = '\"' + *it + '\"';
+ *it = "\"" + *it + "\"";
}
QString ret;
diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h
index 2edac95852..19dc4b1425 100644
--- a/qmake/generators/projectgenerator.h
+++ b/qmake/generators/projectgenerator.h
@@ -51,7 +51,7 @@ class ProjectGenerator : public MakefileGenerator
bool init_flag;
bool addFile(QString);
bool addConfig(const QString &, bool add=true);
- QString getWritableVar(const QString &, bool fixPath=true);
+ QString getWritableVar(const char *, bool fixPath=true);
QString fixPathToQmake(const QString &file);
protected:
virtual void init();
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 01b15b9ee1..ccdb3c816c 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -72,7 +72,7 @@ UnixMakefileGenerator::init()
if(!project->isEmpty("QMAKE_FAILED_REQUIREMENTS")) /* no point */
return;
- QStringList &configs = project->values("CONFIG");
+ ProStringList &configs = project->values("CONFIG");
if(project->isEmpty("ICON") && !project->isEmpty("RC_FILE"))
project->values("ICON") = project->values("RC_FILE");
if(project->isEmpty("QMAKE_EXTENSION_PLUGIN"))
@@ -109,15 +109,15 @@ UnixMakefileGenerator::init()
//If the TARGET looks like a path split it into DESTDIR and the resulting TARGET
if(!project->isEmpty("TARGET")) {
project->values("TARGET") = escapeFilePaths(project->values("TARGET"));
- QString targ = unescapeFilePath(project->first("TARGET"));
+ ProString targ = unescapeFilePath(project->first("TARGET"));
int slsh = qMax(targ.lastIndexOf('/'), targ.lastIndexOf(Option::dir_sep));
if(slsh != -1) {
if(project->isEmpty("DESTDIR"))
project->values("DESTDIR").append("");
else if(project->first("DESTDIR").right(1) != Option::dir_sep)
- project->values("DESTDIR") = QStringList(project->first("DESTDIR") + Option::dir_sep);
- project->values("DESTDIR") = QStringList(project->first("DESTDIR") + targ.left(slsh+1));
- project->values("TARGET") = QStringList(targ.mid(slsh+1));
+ project->values("DESTDIR") = ProStringList(project->first("DESTDIR") + Option::dir_sep);
+ project->values("DESTDIR") = ProStringList(project->first("DESTDIR") + targ.left(slsh+1));
+ project->values("TARGET") = ProStringList(targ.mid(slsh+1));
}
}
@@ -143,9 +143,9 @@ UnixMakefileGenerator::init()
<< (project->isActiveConfig("rvct_linker") ? "--userlibpath "
: project->isActiveConfig("armcc_linker") ? "-L--userlibpath="
: "-L");
- QStringList ldadd;
+ ProStringList ldadd;
if(!project->isEmpty("QMAKE_LIBDIR")) {
- const QStringList &libdirs = project->values("QMAKE_LIBDIR");
+ const ProStringList &libdirs = project->values("QMAKE_LIBDIR");
for(int i = 0; i < libdirs.size(); ++i) {
if(!project->isEmpty("QMAKE_LFLAGS_RPATH") && project->isActiveConfig("rpath_libdirs"))
project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + libdirs[i];
@@ -155,19 +155,19 @@ UnixMakefileGenerator::init()
ldadd += project->values("QMAKE_LIBDIR_FLAGS");
if (project->isActiveConfig("macx")) {
if (!project->isEmpty("QMAKE_FRAMEWORKPATH")) {
- const QStringList &fwdirs = project->values("QMAKE_FRAMEWORKPATH");
+ const ProStringList &fwdirs = project->values("QMAKE_FRAMEWORKPATH");
for (int i = 0; i < fwdirs.size(); ++i)
project->values("QMAKE_FRAMEWORKPATH_FLAGS") += "-F" + escapeFilePath(fwdirs[i]);
}
ldadd += project->values("QMAKE_FRAMEWORKPATH_FLAGS");
}
- QStringList &qmklibs = project->values("QMAKE_LIBS");
+ ProStringList &qmklibs = project->values("QMAKE_LIBS");
qmklibs = ldadd + qmklibs;
if(!project->isEmpty("QMAKE_RPATHDIR")) {
- const QStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
+ const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
for(int i = 0; i < rpathdirs.size(); ++i) {
if(!project->isEmpty("QMAKE_LFLAGS_RPATH"))
- project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(QFileInfo(rpathdirs[i]).absoluteFilePath());
+ project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(QFileInfo(rpathdirs[i].toQString()).absoluteFilePath());
}
}
@@ -185,19 +185,19 @@ UnixMakefileGenerator::init()
compile_flag = "-c";
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
- QString pchFlags = var("QMAKE_" + comps[i] + "FLAGS_USE_PRECOMPILE");
+ QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_USE_PRECOMPILE"));
QString pchBaseName;
if(!project->isEmpty("PRECOMPILED_DIR")) {
- pchBaseName = Option::fixPathToTargetOS(project->first("PRECOMPILED_DIR"));
+ pchBaseName = Option::fixPathToTargetOS(project->first("PRECOMPILED_DIR").toQString());
if(!pchBaseName.endsWith(Option::dir_sep))
pchBaseName += Option::dir_sep;
}
- pchBaseName += project->first("QMAKE_ORIG_TARGET");
+ pchBaseName += project->first("QMAKE_ORIG_TARGET").toQString();
// replace place holders
pchFlags = pchFlags.replace("${QMAKE_PCH_INPUT}",
- fileFixify(project->first("PRECOMPILED_HEADER")));
+ fileFixify(project->first("PRECOMPILED_HEADER").toQString()));
pchFlags = pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName);
if (project->isActiveConfig("icc_pch_style")) {
// icc style
@@ -207,9 +207,9 @@ UnixMakefileGenerator::init()
// gcc style (including clang_pch_style)
QString headerSuffix;
if (project->isActiveConfig("clang_pch_style"))
- headerSuffix = project->first("QMAKE_PCH_OUTPUT_EXT");
+ headerSuffix = project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
else
- pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT");
+ pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
pchBaseName += Option::dir_sep;
QString pchOutputFile;
@@ -246,17 +246,17 @@ UnixMakefileGenerator::init()
if (compiler == "C")
compiler = "CC";
- QString runComp = "QMAKE_RUN_" + compiler;
+ const ProKey runComp("QMAKE_RUN_" + compiler);
if(project->isEmpty(runComp))
project->values(runComp).append("$(" + compiler + ") " + compile_flag + " -o $obj $src");
- QString runCompImp = "QMAKE_RUN_" + compiler + "_IMP";
+ const ProKey runCompImp("QMAKE_RUN_" + compiler + "_IMP");
if(project->isEmpty(runCompImp))
project->values(runCompImp).append("$(" + compiler + ") " + compile_flag + " -o \"$@\" \"$<\"");
}
if(project->isActiveConfig("macx") && !project->isEmpty("TARGET") && !project->isActiveConfig("compile_libtool") &&
((project->isActiveConfig("build_pass") || project->isEmpty("BUILDS")))) {
- QString bundle;
+ ProString bundle;
if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) {
bundle = unescapeFilePath(project->first("TARGET"));
if(!project->isEmpty("QMAKE_BUNDLE_NAME"))
@@ -296,7 +296,7 @@ UnixMakefileGenerator::init()
}
}
if(!bundle.isEmpty()) {
- project->values("QMAKE_BUNDLE") = QStringList(bundle);
+ project->values("QMAKE_BUNDLE") = ProStringList(bundle);
project->values("ALL_DEPS") += project->first("QMAKE_PKGINFO");
project->values("ALL_DEPS") += project->first("QMAKE_BUNDLE_RESOURCE_FILE");
} else {
@@ -317,7 +317,7 @@ UnixMakefileGenerator::init()
if(!project->isEmpty("QMAKE_MAX_FILES_PER_AR")) {
bool ok;
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt(&ok);
- QStringList ar_sublibs, objs = project->values("OBJECTS");
+ ProStringList ar_sublibs, objs = project->values("OBJECTS");
if(ok && max_files > 5 && max_files < (int)objs.count()) {
QString lib;
for(int i = 0, obj_cnt = 0, lib_cnt = 0; i != objs.size(); ++i) {
@@ -344,7 +344,7 @@ UnixMakefileGenerator::init()
"QMAKE_LINK_THREAD", "QMAKE_LINK", "QMAKE_AR_CMD", "QMAKE_LINK_SHLIB_CMD", 0
};
for (int i = 0; libtoolify[i]; i++) {
- QStringList &l = project->values(libtoolify[i]);
+ ProStringList &l = project->values(libtoolify[i]);
if(!l.isEmpty()) {
QString libtool_flags, comp_flags;
if (!strncmp(libtoolify[i], "QMAKE_LINK", 10) || !strcmp(libtoolify[i], "QMAKE_AR_CMD")) {
@@ -361,7 +361,7 @@ UnixMakefileGenerator::init()
if(libtoolify[i] != "QMAKE_AR_CMD") {
QString rpath = Option::output_dir;
if(!project->isEmpty("DESTDIR")) {
- rpath = project->first("DESTDIR");
+ rpath = project->first("DESTDIR").toQString();
if(QDir::isRelativePath(rpath))
rpath.prepend(Option::output_dir + Option::dir_sep);
}
@@ -392,10 +392,10 @@ QStringList
&& file != project->first("QMAKE_IMAGE_COLLECTION")) {
QString header_prefix;
if(!project->isEmpty("PRECOMPILED_DIR"))
- header_prefix = project->first("PRECOMPILED_DIR");
- header_prefix += project->first("QMAKE_ORIG_TARGET");
+ header_prefix = project->first("PRECOMPILED_DIR").toQString();
+ header_prefix += project->first("QMAKE_ORIG_TARGET").toQString();
if (!project->isActiveConfig("clang_pch_style"))
- header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT");
+ header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
if (project->isActiveConfig("icc_pch_style")) {
// icc style
for(QStringList::Iterator it = Option::cpp_ext.begin(); it != Option::cpp_ext.end(); ++it) {
@@ -407,7 +407,7 @@ QStringList
} else {
// gcc style (including clang_pch_style)
QString header_suffix = project->isActiveConfig("clang_pch_style")
- ? project->first("QMAKE_PCH_OUTPUT_EXT") : "";
+ ? project->first("QMAKE_PCH_OUTPUT_EXT").toQString() : "";
header_prefix += Option::dir_sep + project->first("QMAKE_PRECOMP_PREFIX");
for(QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) {
if(file.endsWith(*it)) {
@@ -456,18 +456,18 @@ QStringList
bool
UnixMakefileGenerator::findLibraries()
{
- QString libArg = project->first("QMAKE_L_FLAG");
+ ProString libArg = project->first("QMAKE_L_FLAG");
if (libArg == "-L")
libArg.clear();
QList<QMakeLocalFileName> libdirs;
int libidx = 0;
- foreach (const QString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
- libdirs.append(QMakeLocalFileName(dlib));
+ foreach (const ProString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
+ libdirs.append(QMakeLocalFileName(dlib.toQString()));
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
- QStringList &l = project->values(lflags[i]);
- for (QStringList::Iterator it = l.begin(); it != l.end(); ) {
- QString stub, dir, extn, opt = (*it).trimmed();
+ ProStringList &l = project->values(lflags[i]);
+ for (ProStringList::Iterator it = l.begin(); it != l.end(); ) {
+ QString stub, dir, extn, opt = (*it).trimmed().toQString();
if(opt.startsWith("-")) {
if(opt.startsWith("-L")) {
QString lib = opt.mid(2);
@@ -506,15 +506,14 @@ UnixMakefileGenerator::findLibraries()
}
}
if(!stub.isEmpty()) {
- if (!project->isEmpty("QMAKE_" + stub.toUpper() + "_SUFFIX"))
- stub += project->first("QMAKE_" + stub.toUpper() + "_SUFFIX");
+ stub += project->first(ProKey("QMAKE_" + stub.toUpper() + "_SUFFIX")).toQString();
bool found = false;
- QStringList extens;
+ ProStringList extens;
if(!extn.isNull())
extens << extn;
else
extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a";
- for(QStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
+ for (ProStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) {
if(dir.isNull()) {
for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) {
QString pathToLib = ((*dep_it).local() + Option::dir_sep
@@ -562,18 +561,18 @@ QString linkLib(const QString &file, const QString &libName) {
void
UnixMakefileGenerator::processPrlFiles()
{
- const QString libArg = project->first("QMAKE_L_FLAG");
+ const QString libArg = project->first("QMAKE_L_FLAG").toQString();
QList<QMakeLocalFileName> libdirs, frameworkdirs;
int libidx = 0, fwidx = 0;
- foreach (const QString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
- libdirs.append(QMakeLocalFileName(dlib));
+ foreach (const ProString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS"))
+ libdirs.append(QMakeLocalFileName(dlib.toQString()));
frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks"));
frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
- QStringList &l = project->values(lflags[i]);
+ ProStringList &l = project->values(lflags[i]);
for(int lit = 0; lit < l.size(); ++lit) {
- QString opt = l.at(lit).trimmed();
+ QString opt = l.at(lit).trimmed().toQString();
if(opt.startsWith("-")) {
if (opt.startsWith(libArg)) {
QMakeLocalFileName l(opt.mid(libArg.length()));
@@ -581,6 +580,7 @@ UnixMakefileGenerator::processPrlFiles()
libdirs.insert(libidx++, l);
} else if(opt.startsWith("-l")) {
QString lib = opt.right(opt.length() - 2);
+ QString prl_ext = project->first(ProKey("QMAKE_" + lib.toUpper() + "_SUFFIX")).toQString();
for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) {
const QMakeLocalFileName &lfn = libdirs[dep_i];
if(!project->isActiveConfig("compile_libtool")) { //give them the .libs..
@@ -592,9 +592,7 @@ UnixMakefileGenerator::processPrlFiles()
}
}
- QString prl = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib;
- if(!project->isEmpty("QMAKE_" + lib.toUpper() + "_SUFFIX"))
- prl += project->first("QMAKE_" + lib.toUpper() + "_SUFFIX");
+ QString prl = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib + prl_ext;
if(processPrlFile(prl)) {
if(prl.startsWith(lfn.local()))
prl.replace(0, lfn.local().length(), lfn.real());
@@ -610,7 +608,7 @@ UnixMakefileGenerator::processPrlFiles()
if(opt.length() > 11)
opt = opt.mid(11);
else
- opt = l.at(++lit);
+ opt = l.at(++lit).toQString();
opt = opt.trimmed();
foreach (const QMakeLocalFileName &dir, frameworkdirs) {
QString prl = dir.local() + "/" + opt + ".framework/" + opt + Option::prl_ext;
@@ -626,10 +624,11 @@ UnixMakefileGenerator::processPrlFiles()
opt = linkLib(lib, "");
#endif
if(!opt.isEmpty())
- l.replaceInStrings(lib, opt);
+ for (int k = 0; k < l.size(); ++k)
+ l[k] = l.at(k).toQString().replace(lib, opt);
}
- QStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
+ ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
if(!prl_libs.isEmpty()) {
for(int prl = 0; prl < prl_libs.size(); ++prl)
l.insert(lit+prl+1, prl_libs.at(prl));
@@ -639,14 +638,14 @@ UnixMakefileGenerator::processPrlFiles()
//merge them into a logical order
if(!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) {
- QHash<QString, QStringList> lflags;
+ QHash<ProKey, ProStringList> lflags;
for(int lit = 0; lit < l.size(); ++lit) {
- QString arch("default");
- QString opt = l.at(lit).trimmed();
+ ProKey arch("default");
+ ProString opt = l.at(lit).trimmed();
if(opt.startsWith("-")) {
if (target_mode == TARG_MACX_MODE && opt.startsWith("-Xarch")) {
if (opt.length() > 7) {
- arch = opt.mid(7);
+ arch = opt.mid(7).toKey();
opt = l.at(++lit);
}
}
@@ -670,9 +669,9 @@ UnixMakefileGenerator::processPrlFiles()
}
bool found = false;
for(int x = 0; x < lflags[arch].size(); ++x) {
- QString xf = lflags[arch].at(x);
+ ProString xf = lflags[arch].at(x);
if(xf.startsWith("-framework")) {
- QString framework;
+ ProString framework;
if(xf.length() > 11)
framework = xf.mid(11);
else
@@ -699,9 +698,9 @@ UnixMakefileGenerator::processPrlFiles()
l = lflags.take("default");
// Process architecture specific options (Xarch)
- QHash<QString, QStringList>::const_iterator archIterator = lflags.constBegin();
+ QHash<ProKey, ProStringList>::const_iterator archIterator = lflags.constBegin();
while (archIterator != lflags.constEnd()) {
- const QStringList archOptions = archIterator.value();
+ const ProStringList &archOptions = archIterator.value();
for (int i = 0; i < archOptions.size(); ++i) {
l.append(QLatin1String("-Xarch_") + archIterator.key());
l.append(archOptions.at(i));
@@ -720,20 +719,20 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
bool bundle = false;
const QString root = "$(INSTALL_ROOT)";
- QStringList &uninst = project->values(t + ".uninstall");
- QString ret, destdir=project->first("DESTDIR");
- QString targetdir = Option::fixPathToTargetOS(project->first("target.path"), false);
+ ProStringList &uninst = project->values(ProKey(t + ".uninstall"));
+ QString ret, destdir = project->first("DESTDIR").toQString();
+ QString targetdir = Option::fixPathToTargetOS(project->first("target.path").toQString(), false);
if(!destdir.isEmpty() && destdir.right(1) != Option::dir_sep)
destdir += Option::dir_sep;
targetdir = fileFixify(targetdir, FileFixifyAbsolute);
if(targetdir.right(1) != Option::dir_sep)
targetdir += Option::dir_sep;
- QStringList links;
+ ProStringList links;
QString target="$(TARGET)";
- const QStringList &targets = project->values(t + ".targets");
+ const ProStringList &targets = project->values(ProKey(t + ".targets"));
if(!project->isEmpty("QMAKE_BUNDLE")) {
- target = project->first("QMAKE_BUNDLE");
+ target = project->first("QMAKE_BUNDLE").toQString();
bundle = true;
} else if(project->first("TEMPLATE") == "app") {
target = "$(QMAKE_TARGET)";
@@ -749,7 +748,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
}
}
for(int i = 0; i < targets.size(); ++i) {
- QString src = targets.at(i),
+ QString src = targets.at(i).toQString(),
dst = filePrefixRoot(root, targetdir + src.section('/', -1));
if(!ret.isEmpty())
ret += "\n\t";
@@ -790,7 +789,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
copy_cmd += "$(INSTALL_PROGRAM)";
copy_cmd += " \"" + src_targ + "\" \"" + dst_targ + "\"";
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
- && project->values(t + ".CONFIG").indexOf("fix_rpath") != -1) {
+ && project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
if(!project->isEmpty("QMAKE_FIX_RPATH")) {
ret += copy_cmd;
ret += "\n\t-" + var("QMAKE_FIX_RPATH") + " \"" +
@@ -862,7 +861,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_meta + "\"");
- const QString replace_rule("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE");
+ const ProKey replace_rule("QMAKE_" + type.toUpper() + "_INSTALL_REPLACE");
const QString dst_meta_dir = fileInfo(dst_meta).path();
if(!dst_meta_dir.isEmpty()) {
if(!ret.isEmpty())
@@ -878,10 +877,10 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
if(!ret.isEmpty())
ret += "\n\t";
ret += "-$(SED)";
- QStringList replace_rules = project->values(replace_rule);
+ const ProStringList &replace_rules = project->values(replace_rule);
for(int r = 0; r < replace_rules.size(); ++r) {
- const QString match = project->first(replace_rules.at(r) + ".match"),
- replace = project->first(replace_rules.at(r) + ".replace");
+ const ProString &match = project->first(ProKey(replace_rules.at(r) + ".match")),
+ &replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
if(!match.isEmpty() /*&& match != replace*/)
ret += " -e \"s," + match + "," + replace + ",g\"";
}
diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h
index 8fb005200b..eba246d874 100644
--- a/qmake/generators/unix/unixmake.h
+++ b/qmake/generators/unix/unixmake.h
@@ -65,6 +65,7 @@ protected:
virtual bool findLibraries();
virtual QString escapeFilePath(const QString &path) const;
+ ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); }
virtual QStringList &findDependencies(const QString &);
virtual void init();
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 45ed14917f..abb013fe8e 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -82,8 +82,8 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
writeHeader(t);
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "first all clean install distclean uninstall qmake_all:" << "\n\t"
<< "@echo \"Some of the required modules ("
@@ -134,9 +134,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << " -I" << pwd;
}
{
- const QStringList &incs = project->values("INCLUDEPATH");
+ const ProStringList &incs = project->values("INCLUDEPATH");
for(int i = 0; i < incs.size(); ++i) {
- QString inc = escapeFilePath(incs.at(i));
+ ProString inc = escapeFilePath(incs.at(i));
if(!inc.isEmpty())
t << " " << "-I" << inc;
}
@@ -188,15 +188,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES"))) << " "
<< valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
if(do_incremental) {
- const QStringList &objs = project->values("OBJECTS");
- const QStringList &incrs = project->values("QMAKE_INCREMENTAL");
- QStringList incrs_out;
+ const ProStringList &objs = project->values("OBJECTS");
+ const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
+ ProStringList incrs_out;
t << "OBJECTS = ";
- for (QStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
+ for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
bool increment = false;
- for (QStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
- if((*objit).indexOf(QRegExp((*incrit), Qt::CaseSensitive,
- QRegExp::Wildcard)) != -1) {
+ for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
+ if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
+ QRegExp::Wildcard)) != -1) {
increment = true;
incrs_out.append((*objit));
break;
@@ -219,7 +219,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(do_incremental && !src_incremental)
do_incremental = false;
- t << "DIST = " << valList(fileFixify(project->values("DISTFILES"))) << endl;
+ t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << endl;
t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl;
t << "DESTDIR = " << var("DESTDIR") << endl;
if(project->isActiveConfig("compile_libtool"))
@@ -247,8 +247,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl;
// blasted includes
- const QStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
- QStringList::ConstIterator it;
+ const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
+ ProStringList::ConstIterator it;
for(it = qeui.begin(); it != qeui.end(); ++it)
t << "include " << (*it) << endl;
@@ -268,11 +268,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(include_deps) {
if (project->isActiveConfig("gcc_MD_depends")) {
- QStringList objects = project->values("OBJECTS");
- for(QStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
- QString d_file = (*it).replace(QRegExp(Option::obj_ext + "$"), ".d");
+ ProStringList objects = project->values("OBJECTS");
+ for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
+ QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
t << "-include " << d_file << endl;
- project->values("QMAKE_DISTCLEAN") += d_file;
+ project->values("QMAKE_DISTCLEAN") << d_file;
}
} else {
QString cmd=var("QMAKE_CFLAGS_DEPS") + " ";
@@ -280,7 +280,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
cmd += " -I" + project->first("QMAKE_ABSOLUTE_SOURCE_PATH") + " ";
cmd += " $(INCPATH) " + varGlue("DEPENDPATH", "-I", " -I", "");
- QString odir;
+ ProString odir;
if(!project->values("OBJECTS_DIR").isEmpty())
odir = project->first("OBJECTS_DIR");
@@ -301,14 +301,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 };
for (int x = 0; src[x]; x++) {
- const QStringList &l = project->values(src[x]);
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ const ProStringList &l = project->values(src[x]);
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if(!(*it).isEmpty()) {
QString d_file;
for(QStringList::Iterator cit = Option::c_ext.begin();
cit != Option::c_ext.end(); ++cit) {
if((*it).endsWith((*cit))) {
- d_file = (*it).left((*it).length() - (*cit).length());
+ d_file = (*it).left((*it).length() - (*cit).length()).toQString();
break;
}
}
@@ -316,7 +316,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(QStringList::Iterator cppit = Option::cpp_ext.begin();
cppit != Option::cpp_ext.end(); ++cppit) {
if((*it).endsWith((*cppit))) {
- d_file = (*it).left((*it).length() - (*cppit).length());
+ d_file = (*it).left((*it).length() - (*cppit).length()).toQString();
break;
}
}
@@ -324,7 +324,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!d_file.isEmpty()) {
d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d";
- QStringList deps = findDependencies((*it)).filter(QRegExp(
+ QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
if(!deps.isEmpty())
t << d_file << ": " << deps.join(" ") << endl;
@@ -339,23 +339,23 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "####### Build rules" << endl << endl;
if(!project->values("SUBLIBS").isEmpty()) {
- QString libdir = "tmp/";
+ ProString libdir = "tmp/";
if(!project->isEmpty("SUBLIBS_DIR"))
libdir = project->first("SUBLIBS_DIR");
t << "SUBLIBS = ";
- const QStringList &l = project->values("SUBLIBS");
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
+ const ProStringList &l = project->values("SUBLIBS");
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "."
<< project->first("QMAKE_EXTENSION_STATICLIB") << " ";
t << endl << endl;
}
if(project->isActiveConfig("depend_prl") && !project->isEmpty("QMAKE_PRL_INTERNAL_FILES")) {
- const QStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES");
- QStringList::ConstIterator it;
+ const ProStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES");
+ ProStringList::ConstIterator it;
for(it = l.begin(); it != l.end(); ++it) {
QMakeMetaInfo libinfo(project);
- if(libinfo.readLib((*it)) && !libinfo.isEmpty("QMAKE_PRL_BUILD_DIR")) {
- QString dir;
+ if (libinfo.readLib((*it).toQString()) && !libinfo.isEmpty("QMAKE_PRL_BUILD_DIR")) {
+ ProString dir;
int slsh = (*it).lastIndexOf(Option::dir_sep);
if(slsh != -1)
dir = (*it).left(slsh + 1);
@@ -369,9 +369,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
if (!project->values("QMAKE_APP_FLAG").isEmpty() || project->first("TEMPLATE") == "aux") {
- QString destdir = project->first("DESTDIR");
+ QString destdir = project->first("DESTDIR").toQString();
if(!project->isEmpty("QMAKE_BUNDLE")) {
- QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
+ QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION").toQString();
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
if(!bundle_loc.endsWith("/"))
@@ -458,9 +458,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
}
} else if(!project->isActiveConfig("staticlib")) {
- QString destdir = unescapeFilePath(project->first("DESTDIR")), incr_deps;
+ QString destdir = unescapeFilePath(project->first("DESTDIR").toQString()), incr_deps;
if(!project->isEmpty("QMAKE_BUNDLE")) {
- QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
+ QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION").toQString();
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
if(!bundle_loc.endsWith("/"))
@@ -470,7 +470,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
destdir = escapeFilePath(destdir);
if(do_incremental) {
- QString s_ext = project->values("QMAKE_EXTENSION_SHLIB").first();
+ ProString s_ext = project->first("QMAKE_EXTENSION_SHLIB");
QString incr_target = var("QMAKE_ORIG_TARGET").replace(
QRegExp("\\." + s_ext), "").replace(QRegExp("^lib"), "") + "_incremental";
if(incr_target.indexOf(Option::dir_sep) != -1)
@@ -485,8 +485,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << incr_target_dir << ": " << link_deps << "\n\t"
<< "ld -r -o " << incr_target_dir << " " << link_deps << endl;
//communicated below
- QStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
- cmd.first().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick
+ ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
+ cmd[0] = cmd.at(0).toQString().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick
cmd.append(incr_target_dir);
deps.prepend(incr_target_dir + " ");
incr_deps = "$(INCREMENTAL_OBJECTS)";
@@ -506,7 +506,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir <<
" $(INCREMENTAL_OBJECTS)" << endl;
//communicated below
- QStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
+ ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
if(!destdir.isEmpty())
cmd.append(" -L" + destdir);
cmd.append(" -l" + incr_target);
@@ -609,7 +609,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
}
} else {
- QString destdir = project->first("DESTDIR");
+ QString destdir = project->first("DESTDIR").toQString();
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << destdir << "$(TARGET) "
<< varGlue("QMAKE_AR_SUBLIBS", destdir, " " + destdir, "") << "\n\n"
<< "staticlib: " << destdir << "$(TARGET)" << "\n\n";
@@ -629,19 +629,19 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t" << "-$(MOVE) $(TARGET) " << destdir << "\n";
} else {
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt();
- QStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"),
+ ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"),
libs = project->values("QMAKE_AR_SUBLIBS");
libs.prepend("$(TARGET)");
- for(QStringList::Iterator libit = libs.begin(), objit = objs.begin();
- libit != libs.end(); ++libit) {
- QStringList build;
+ for (ProStringList::Iterator libit = libs.begin(), objit = objs.begin();
+ libit != libs.end(); ++libit) {
+ ProStringList build;
for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++)
build << (*objit);
QString ar;
if((*libit) == "$(TARGET)") {
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
<< " " << var("POST_TARGETDEPS") << valList(build) << "\n\t";
- ar = project->values("QMAKE_AR_CMD").first();
+ ar = project->first("QMAKE_AR_CMD").toQString();
ar = ar.replace("$(OBJECTS)", build.join(" "));
} else {
t << (*libit) << ": " << valList(build) << "\n\t";
@@ -683,7 +683,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->first("QMAKE_PKGINFO").isEmpty()) {
- QString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO"));
+ ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO"));
QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents");
t << pkginfo << ": " << "\n\t";
if(!destdir.isEmpty())
@@ -694,7 +694,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\" >" << pkginfo << endl;
}
if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
- QString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE"));
+ ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE"));
QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources");
t << resources << ": " << "\n\t";
t << mkdir_p_asstring(destdir) << "\n\t";
@@ -702,13 +702,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_BUNDLE")) {
//copy the plist
- QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST"))),
- info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT"));
+ QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())),
+ info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString());
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
t << info_plist_out << ": " << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
- QStringList commonSedArgs;
+ ProStringList commonSedArgs;
if (!project->values("VERSION").isEmpty())
commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" ";
commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
@@ -717,7 +717,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString icon = fileFixify(var("ICON"));
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
- foreach (const QString &arg, commonSedArgs)
+ foreach (const ProString &arg, commonSedArgs)
t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
@@ -736,7 +736,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} else {
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
- foreach (const QString &arg, commonSedArgs)
+ foreach (const ProString &arg, commonSedArgs)
t << arg;
t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"
@@ -747,29 +747,32 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
//copy other data
if(!project->isEmpty("QMAKE_BUNDLE_DATA")) {
QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/";
- const QStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
+ const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
for(int i = 0; i < bundle_data.count(); i++) {
- const QStringList &files = project->values(bundle_data[i] + ".files");
+ const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
QString path = bundle_dir;
- if(!project->isEmpty(bundle_data[i] + ".version")) {
- QString version = project->first(bundle_data[i] + ".version") + "/" +
+ const ProKey vkey(bundle_data[i] + ".version");
+ const ProKey pkey(bundle_data[i] + ".path");
+ if (!project->isEmpty(vkey)) {
+ QString version = project->first(vkey) + "/" +
project->first("QMAKE_FRAMEWORK_VERSION") + "/";
- t << Option::fixPathToLocalOS(path + project->first(bundle_data[i] + ".path")) << ": " << "\n\t"
+ t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": " << "\n\t"
<< mkdir_p_asstring(path) << "\n\t"
- << "@$(SYMLINK) " << version << project->first(bundle_data[i] + ".path") << " " << path << endl;
+ << "@$(SYMLINK) " << version << project->first(pkey) << " " << path << endl;
path += version;
}
- path += project->first(bundle_data[i] + ".path");
+ path += project->first(pkey).toQString();
path = Option::fixPathToLocalOS(path);
for(int file = 0; file < files.count(); file++) {
- QString src = fileFixify(files[file], FileFixifyAbsolute);
+ QString fn = files.at(file).toQString();
+ QString src = fileFixify(fn, FileFixifyAbsolute);
if (!QFile::exists(src))
- src = files[file];
+ src = fn;
src = escapeFilePath(src);
- const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(files[file]).fileName());
+ const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(fn).fileName());
t << dst << ": " << src << "\n\t"
<< mkdir_p_asstring(path) << "\n\t";
- QFileInfo fi(fileInfo(files[file]));
+ QFileInfo fi(fileInfo(fn));
if(fi.isDir())
t << "@$(DEL_FILE) -r " << dst << "\n\t"
<< "@$(COPY_DIR) " << src << " " << dst << endl;
@@ -781,8 +784,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
- QString ddir;
- QString packageName(project->first("QMAKE_ORIG_TARGET"));
+ ProString ddir;
+ ProString packageName(project->first("QMAKE_ORIG_TARGET"));
if(!project->isActiveConfig("no_dist_version"))
packageName += var("VERSION");
if (project->isEmpty("QMAKE_DISTDIR"))
@@ -790,18 +793,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
else
ddir = project->first("QMAKE_DISTDIR");
- QString ddir_c = escapeFilePath(fileFixify((project->isEmpty("OBJECTS_DIR") ? QString(".tmp/") :
+ QString ddir_c = escapeFilePath(fileFixify((project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") :
project->first("OBJECTS_DIR")) + ddir,
Option::output_dir, Option::output_dir));
t << "dist: " << "\n\t"
<< mkdir_p_asstring(ddir_c) << "\n\t"
<< "$(COPY_FILE) --parents $(SOURCES) $(DIST) " << ddir_c << Option::dir_sep << " && ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- const QStringList &var = project->values((*it)+".input");
- for(QStringList::ConstIterator var_it = var.begin(); var_it != var.end(); ++var_it) {
- const QStringList &val = project->values((*var_it));
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ const ProStringList &var = project->values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator var_it = var.begin(); var_it != var.end(); ++var_it) {
+ const ProStringList &val = project->values((*var_it).toKey());
if(val.isEmpty())
continue;
t << "$(COPY_FILE) --parents " << val.join(" ") << " " << ddir_c << Option::dir_sep << " && ";
@@ -835,8 +838,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "-$(DEL_FILE) $(OBJECTS)" << "\n\t";
}
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
- QStringList precomp_files;
- QString precomph_out_dir;
+ ProStringList precomp_files;
+ ProString precomph_out_dir;
if(!project->isEmpty("PRECOMPILED_DIR"))
precomph_out_dir = project->first("PRECOMPILED_DIR");
@@ -846,21 +849,21 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (project->isActiveConfig("icc_pch_style")) {
// icc style
- QString pchBaseName = project->first("QMAKE_ORIG_TARGET");
- QString pchOutput;
+ ProString pchBaseName = project->first("QMAKE_ORIG_TARGET");
+ ProString pchOutput;
if(!project->isEmpty("PRECOMPILED_DIR"))
pchOutput = project->first("PRECOMPILED_DIR");
pchOutput += pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT");
- QString sourceFile = pchOutput + Option::cpp_ext.first();
- QString objectFile = createObjectList(QStringList(sourceFile)).first();
+ ProString sourceFile = pchOutput + Option::cpp_ext.first();
+ ProString objectFile = createObjectList(ProStringList(sourceFile)).first();
precomp_files << precomph_out_dir << sourceFile << objectFile;
} else {
// gcc style (including clang_pch_style)
precomph_out_dir += Option::dir_sep;
- QString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
- QString header_suffix = project->isActiveConfig("clang_pch_style")
+ ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
+ ProString header_suffix = project->isActiveConfig("clang_pch_style")
? project->first("QMAKE_PCH_OUTPUT_EXT") : "";
if(!project->isEmpty("QMAKE_CFLAGS_PRECOMPILE"))
@@ -885,18 +888,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< varGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
t << "####### Sub-libraries" << endl << endl;
if (!project->values("SUBLIBS").isEmpty()) {
- QString libdir = "tmp/";
+ ProString libdir = "tmp/";
if(!project->isEmpty("SUBLIBS_DIR"))
libdir = project->first("SUBLIBS_DIR");
- const QStringList &l = project->values("SUBLIBS");
+ const ProStringList &l = project->values("SUBLIBS");
for(it = l.begin(); it != l.end(); ++it)
t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "."
<< project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t"
- << var(QString("MAKELIB") + (*it)) << endl << endl;
+ << var(ProKey("MAKELIB" + *it)) << endl << endl;
}
- QString destdir = project->first("DESTDIR");
- if(!destdir.isEmpty() && destdir.right(1) != Option::dir_sep)
+ ProString destdir = project->first("DESTDIR");
+ if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
destdir += Option::dir_sep;
t << "distclean: " << "clean\n";
if(!project->isEmpty("QMAKE_BUNDLE")) {
@@ -921,11 +924,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
- QString pchInput = project->first("PRECOMPILED_HEADER");
+ QString pchInput = project->first("PRECOMPILED_HEADER").toQString();
t << "###### Prefix headers" << endl;
QString comps[] = { "C", "CXX", "OBJC", "OBJCXX", QString() };
for(int i = 0; !comps[i].isNull(); i++) {
- QString pchFlags = var("QMAKE_" + comps[i] + "FLAGS_PRECOMPILE");
+ QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_PRECOMPILE"));
if(pchFlags.isEmpty())
continue;
@@ -935,8 +938,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
else
cflags += " $(" + comps[i] + "FLAGS)";
- QString pchBaseName = project->first("QMAKE_ORIG_TARGET");
- QString pchOutput;
+ ProString pchBaseName = project->first("QMAKE_ORIG_TARGET");
+ ProString pchOutput;
if(!project->isEmpty("PRECOMPILED_DIR"))
pchOutput = project->first("PRECOMPILED_DIR");
pchOutput += pchBaseName;
@@ -946,7 +949,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (project->isActiveConfig("icc_pch_style")) {
// icc style
QString sourceFile = pchOutput + Option::cpp_ext.first();
- QString objectFile = createObjectList(QStringList(sourceFile)).first();
+ QString objectFile = createObjectList(ProStringList(sourceFile)).first().toQString();
t << pchOutput << ": " << pchInput << " " << findDependencies(pchInput).join(" \\\n\t\t")
<< "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile
<< "\n\trm -f " << pchOutput;
@@ -955,11 +958,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
.replace("${QMAKE_PCH_TEMP_OBJECT}", objectFile);
} else {
// gcc style (including clang_pch_style)
- QString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
- QString header_suffix = project->isActiveConfig("clang_pch_style")
+ ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
+ ProString header_suffix = project->isActiveConfig("clang_pch_style")
? project->first("QMAKE_PCH_OUTPUT_EXT") : "";
pchOutput += Option::dir_sep;
- QString pchOutputDir = pchOutput, pchOutputFile;
+ QString pchOutputDir = pchOutput.toQString(), pchOutputFile;
if(comps[i] == "C") {
pchOutputFile = "c";
@@ -979,8 +982,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\n\t" << mkdir_p_asstring(pchOutputDir);
}
pchFlags = pchFlags.replace("${QMAKE_PCH_INPUT}", pchInput)
- .replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName)
- .replace("${QMAKE_PCH_OUTPUT}", pchOutput);
+ .replace("${QMAKE_PCH_OUTPUT_BASE}", pchBaseName.toQString())
+ .replace("${QMAKE_PCH_OUTPUT}", pchOutput.toQString());
QString compiler;
if(comps[i] == "C" || comps[i] == "OBJC" || comps[i] == "OBJCXX")
@@ -1004,7 +1007,7 @@ void UnixMakefileGenerator::init2()
project->values("VERSION").append("1.0." +
(project->isEmpty("VER_PAT") ? QString("0") :
project->first("VER_PAT")));
- QStringList l = project->first("VERSION").split('.');
+ QStringList l = project->first("VERSION").toQString().split('.');
l << "0" << "0"; //make sure there are three
project->values("VER_MAJ").append(l[0]);
project->values("VER_MIN").append(l[1]);
@@ -1017,7 +1020,7 @@ void UnixMakefileGenerator::init2()
if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
if(!project->isEmpty("QMAKE_BUNDLE")) {
- QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
+ ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
if(!bundle_loc.endsWith("/"))
@@ -1037,16 +1040,17 @@ void UnixMakefileGenerator::init2()
project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB")
+ project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB"));
if(project->isActiveConfig("compile_libtool"))
- project->values("TARGET_la") = QStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext);
+ project->values("TARGET_la") = ProStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext);
- if (!project->values("QMAKE_AR_CMD").isEmpty())
- project->values("QMAKE_AR_CMD").first().replace("(TARGET)","(TARGETA)");
+ ProStringList &ar_cmd = project->values("QMAKE_AR_CMD");
+ if (!ar_cmd.isEmpty())
+ ar_cmd[0] = ar_cmd.at(0).toQString().replace("(TARGET)","(TARGETA)");
else
- project->values("QMAKE_AR_CMD").append("$(AR) $(TARGETA) $(OBJECTS)");
+ ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)");
if(project->isActiveConfig("compile_libtool")) {
project->values("TARGET") = project->values("TARGET_la");
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
- QString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
+ ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
if(!bundle_loc.endsWith("/"))
@@ -1150,7 +1154,7 @@ void UnixMakefileGenerator::init2()
if(project->isEmpty("QMAKE_LN_SHLIB"))
project->values("QMAKE_LN_SHLIB").append("ln -s");
if (!project->values("QMAKE_LFLAGS_SONAME").isEmpty()) {
- QString soname;
+ ProString soname;
if(project->isActiveConfig("plugin")) {
if(!project->values("TARGET").isEmpty())
soname += project->first("TARGET");
@@ -1163,7 +1167,7 @@ void UnixMakefileGenerator::init2()
if(project->isActiveConfig("absolute_library_soname") &&
project->values("INSTALLS").indexOf("target") != -1 &&
!project->isEmpty("target.path")) {
- QString instpath = Option::fixPathToTargetOS(project->first("target.path"));
+ QString instpath = Option::fixPathToTargetOS(project->first("target.path").toQString());
if(!instpath.endsWith(Option::dir_sep))
instpath += Option::dir_sep;
soname.prepend(instpath);
@@ -1218,7 +1222,7 @@ void UnixMakefileGenerator::init2()
}
if(!project->isEmpty("QMAKE_BUNDLE")) {
- QString plist = fileFixify(project->first("QMAKE_INFO_PLIST"));
+ QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString());
if(plist.isEmpty())
plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
if(exists(Option::fixPathToLocalOS(plist))) {
@@ -1231,24 +1235,25 @@ void UnixMakefileGenerator::init2()
if(!project->isEmpty("ICON") && project->first("TEMPLATE") == "app")
project->values("ALL_DEPS") += project->first("DESTDIR") +
project->first("QMAKE_BUNDLE") +
- "/Contents/Resources/" + project->first("ICON").section('/', -1);
+ "/Contents/Resources/" + project->first("ICON").toQString().section('/', -1);
if(!project->isEmpty("QMAKE_BUNDLE_DATA")) {
QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/";
- QStringList &alldeps = project->values("ALL_DEPS");
- const QStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
+ ProStringList &alldeps = project->values("ALL_DEPS");
+ const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
for(int i = 0; i < bundle_data.count(); i++) {
- const QStringList &files = project->values(bundle_data[i] + ".files");
+ const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
QString path = bundle_dir;
- if(!project->isEmpty(bundle_data[i] + ".version")) {
- alldeps += Option::fixPathToLocalOS(path + Option::dir_sep +
- project->first(bundle_data[i] + ".path"));
- path += project->first(bundle_data[i] + ".version") + "/" +
+ const ProKey vkey(bundle_data[i] + ".version");
+ const ProKey pkey(bundle_data[i] + ".path");
+ if (!project->isEmpty(vkey)) {
+ alldeps += Option::fixPathToLocalOS(path + Option::dir_sep + project->first(pkey));
+ path += project->first(vkey) + "/" +
project->first("QMAKE_FRAMEWORK_VERSION") + "/";
}
- path += project->first(bundle_data[i] + ".path");
+ path += project->first(pkey);
path = Option::fixPathToLocalOS(path);
for(int file = 0; file < files.count(); file++)
- alldeps += path + Option::dir_sep + fileInfo(files[file]).fileName();
+ alldeps += path + Option::dir_sep + fileInfo(files[file].toQString()).fileName();
}
}
}
@@ -1270,7 +1275,7 @@ UnixMakefileGenerator::libtoolFileName(bool fixify)
ret.prepend(project->first("QMAKE_LIBTOOL_DESTDIR") + Option::dir_sep);
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
- ret.prepend(project->first("DESTDIR"));
+ ret.prepend(project->first("DESTDIR").toQString());
ret = Option::fixPathToLocalOS(fileFixify(ret, qmake_getpwd(), Option::output_dir));
}
return ret;
@@ -1314,14 +1319,14 @@ UnixMakefileGenerator::writeLibtoolFile()
<< "old_library='" << lname.left(lname.length()-Option::libtool_ext.length()) << ".a'\n\n";
t << "# Libraries that this one depends upon.\n";
- QStringList libs;
+ ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS"))
libs = project->values("QMAKE_INTERNAL_PRL_LIBS");
else
libs << "QMAKE_LIBS"; //obvious one
t << "dependency_libs='";
- for(QStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
- t << project->values((*it)).join(" ") << " ";
+ for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
+ t << project->values((*it).toKey()).join(" ") << " ";
t << "'\n\n";
t << "# Version information for " << lname << "\n";
@@ -1339,13 +1344,13 @@ UnixMakefileGenerator::writeLibtoolFile()
"dlopen=''\n"
"dlpreopen=''\n\n";
- QString install_dir = project->first("QMAKE_LIBTOOL_LIBDIR");
+ ProString install_dir = project->first("QMAKE_LIBTOOL_LIBDIR");
if(install_dir.isEmpty())
install_dir = project->first("target.path");
if(install_dir.isEmpty())
install_dir = project->first("DESTDIR");
t << "# Directory that this library needs to be installed in:\n"
- "libdir='" << Option::fixPathToTargetOS(install_dir, false) << "'\n";
+ "libdir='" << Option::fixPathToTargetOS(install_dir.toQString(), false) << "'\n";
}
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index c9834117e9..a630d19f07 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -42,6 +42,9 @@
#include "mingw_make.h"
#include "option.h"
#include "meta.h"
+
+#include <proitems.h>
+
#include <qregexp.h>
#include <qdir.h>
#include <stdlib.h>
@@ -76,14 +79,13 @@ bool MingwMakefileGenerator::findLibraries()
QList<QMakeLocalFileName> dirs;
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
- QStringList &l = project->values(lflags[i]);
- QStringList::Iterator it = l.begin();
+ ProStringList &l = project->values(lflags[i]);
+ ProStringList::Iterator it = l.begin();
while (it != l.end()) {
if ((*it).startsWith("-l")) {
- QString steam = (*it).mid(2), out;
- QString suffix;
- if (!project->isEmpty("QMAKE_" + steam.toUpper() + "_SUFFIX"))
- suffix = project->first("QMAKE_" + steam.toUpper() + "_SUFFIX");
+ QString steam = (*it).mid(2).toQString();
+ ProString out;
+ QString suffix = project->first(ProKey("QMAKE_" + steam.toUpper() + "_SUFFIX")).toQString();
for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
QString extension;
int ver = findHighestVersion((*dir_it).local(), steam, "dll.a|a");
@@ -93,14 +95,14 @@ bool MingwMakefileGenerator::findLibraries()
if(QMakeMetaInfo::libExists((*dir_it).local() + Option::dir_sep + steam) ||
exists((*dir_it).local() + Option::dir_sep + steam + extension + ".a") ||
exists((*dir_it).local() + Option::dir_sep + steam + extension + ".dll.a")) {
- out = (*it) + extension;
+ out = *it + extension;
break;
}
}
if (!out.isEmpty()) // We assume if it never finds it that its correct
(*it) = out;
} else if((*it).startsWith("-L")) {
- dirs.append(QMakeLocalFileName((*it).mid(2)));
+ dirs.append(QMakeLocalFileName((*it).mid(2).toQString()));
}
++it;
@@ -129,8 +131,8 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
if(Option::mkfile::do_stub_makefile) {
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "first all clean install distclean uninstall: qmake" << endl
<< "qmake_all:" << endl;
@@ -148,18 +150,19 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
return false;
}
-void createLdObjectScriptFile(const QString &fileName, const QStringList &objList)
+void createLdObjectScriptFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
t << "INPUT(" << endl;
- for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
- if (QDir::isRelativePath(*it))
- t << "./" << *it << endl;
- else
- t << *it << endl;
+ for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ QString path = (*it).toQString();
+ if (QDir::isRelativePath(path))
+ t << "./" << path << endl;
+ else
+ t << path << endl;
}
t << ");" << endl;
t.flush();
@@ -167,14 +170,14 @@ void createLdObjectScriptFile(const QString &fileName, const QStringList &objLis
}
}
-void createArObjectScriptFile(const QString &fileName, const QString &target, const QStringList &objList)
+void createArObjectScriptFile(const QString &fileName, const QString &target, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
t << "CREATE " << target << endl;
- for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
t << "ADDMOD " << *it << endl;
}
t << "SAVE" << endl;
@@ -183,17 +186,18 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
}
}
-void createRvctObjectScriptFile(const QString &fileName, const QStringList &objList)
+void createRvctObjectScriptFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
- for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
- if (QDir::isRelativePath(*it))
- t << "./" << *it << endl;
+ for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ QString path = (*it).toQString();
+ if (QDir::isRelativePath(path))
+ t << "./" << path << endl;
else
- t << *it << endl;
+ t << path << endl;
}
t.flush();
file.close();
@@ -205,7 +209,7 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
writeStandardParts(t);
if (!preCompHeaderOut.isEmpty()) {
- QString header = project->first("PRECOMPILED_HEADER");
+ QString header = project->first("PRECOMPILED_HEADER").toQString();
QString cHeader = preCompHeaderOut + Option::dir_sep + "c";
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
@@ -259,7 +263,7 @@ void MingwMakefileGenerator::init()
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE"));
}
- QStringList &configs = project->values("CONFIG");
+ ProStringList &configs = project->values("CONFIG");
if(project->isActiveConfig("qt_dll"))
if(configs.indexOf("qt") == -1)
@@ -275,7 +279,7 @@ void MingwMakefileGenerator::init()
}
if (!project->values("DEF_FILE").isEmpty()) {
- QString defFileName = fileFixify(project->values("DEF_FILE")).first();
+ QString defFileName = fileFixify(project->first("DEF_FILE").toQString());
project->values("QMAKE_LFLAGS").append(QString("-Wl,") + escapeFilePath(defFileName));
}
@@ -288,7 +292,7 @@ void MingwMakefileGenerator::init()
if (!project->first("PRECOMPILED_HEADER").isEmpty()
&& project->isActiveConfig("precompile_header")) {
QString preCompHeader = var("PRECOMPILED_DIR")
- + QFileInfo(project->first("PRECOMPILED_HEADER")).fileName();
+ + QFileInfo(project->first("PRECOMPILED_HEADER").toQString()).fileName();
preCompHeaderOut = preCompHeader + ".gch";
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c");
project->values("QMAKE_CLEAN").append(preCompHeaderOut + Option::dir_sep + "c++");
@@ -316,9 +320,9 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
{
t << "INCPATH = ";
- const QStringList &incs = project->values("INCLUDEPATH");
- for (QStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
- QString inc = (*incit);
+ const ProStringList &incs = project->values("INCLUDEPATH");
+ for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
+ QString inc = (*incit).toQString();
inc.replace(QRegExp("\\\\$"), "");
inc.replace(QRegExp("\""), "");
t << "-I" << quote << inc << quote << " ";
@@ -403,7 +407,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
{
- const QString rc_file = fileFixify(project->first("RC_FILE"));
+ const QString rc_file = fileFixify(project->first("RC_FILE").toQString());
QString incPathStr = fileInfo(rc_file).path();
if (incPathStr != "." && QDir::isRelativePath(incPathStr))
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 304cc452c0..015bdc4828 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -59,8 +59,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
{
writeHeader(t);
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
- const QStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
+ const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
+ for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "all first clean:" << "\n\t"
<< "@echo \"Some of the required modules ("
@@ -78,7 +78,7 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
return MakefileGenerator::writeStubMakefile(t);
#endif
if (!project->isHostBuild()) {
- const QHash<QString, QStringList> &variables = project->variables();
+ const ProValueMap &variables = project->variables();
if (variables["QMAKESPEC"].first().contains("wince", Qt::CaseInsensitive)) {
CeSdkHandler sdkhandler;
sdkhandler.parse();
@@ -133,8 +133,8 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
QString ret = Win32MakefileGenerator::defaultInstall(t);
const QString root = "$(INSTALL_ROOT)";
- QStringList &uninst = project->values(t + ".uninstall");
- QString targetdir = Option::fixPathToTargetOS(project->first(t + ".path"), false);
+ ProStringList &uninst = project->values(ProKey(t + ".uninstall"));
+ QString targetdir = Option::fixPathToTargetOS(project->first(ProKey(t + ".path")).toQString(), false);
targetdir = fileFixify(targetdir, FileFixifyAbsolute);
if(targetdir.right(1) != Option::dir_sep)
targetdir += Option::dir_sep;
@@ -186,7 +186,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
}
}
-QString NmakeMakefileGenerator::var(const QString &value)
+QString NmakeMakefileGenerator::var(const ProKey &value)
{
if (usePCH) {
if ((value == "QMAKE_RUN_CXX_IMP_BATCH"
@@ -252,15 +252,15 @@ void NmakeMakefileGenerator::init()
}
if (!project->values("DEF_FILE").isEmpty()) {
- QString defFileName = fileFixify(project->values("DEF_FILE")).first();
+ QString defFileName = fileFixify(project->first("DEF_FILE").toQString());
project->values("QMAKE_LFLAGS").append(QString("/DEF:") + escapeFilePath(defFileName));
}
if(!project->values("VERSION").isEmpty()) {
- QString version = project->values("VERSION")[0];
+ ProString version = project->values("VERSION")[0];
int firstDot = version.indexOf(".");
- QString major = version.left(firstDot);
- QString minor = version.right(version.length() - firstDot - 1);
+ QString major = version.left(firstDot).toQString();
+ QString minor = version.right(version.length() - firstDot - 1).toQString();
minor.replace(".", "");
project->values("QMAKE_LFLAGS").append("/VERSION:" + major + "." + minor);
}
@@ -269,7 +269,7 @@ void NmakeMakefileGenerator::init()
MakefileGenerator::init();
// Setup PCH variables
- precompH = project->first("PRECOMPILED_HEADER");
+ precompH = project->first("PRECOMPILED_HEADER").toQString();
usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header");
if (usePCH) {
// Created files
@@ -280,11 +280,11 @@ void NmakeMakefileGenerator::init()
// Add pch file to cleanup
project->values("QMAKE_CLEAN") += precompPch;
// Return to variable pool
- project->values("PRECOMPILED_OBJECT") = QStringList(precompObj);
- project->values("PRECOMPILED_PCH") = QStringList(precompPch);
+ project->values("PRECOMPILED_OBJECT") = ProStringList(precompObj);
+ project->values("PRECOMPILED_PCH") = ProStringList(precompPch);
}
- QString version = project->first("TARGET_VERSION_EXT");
+ ProString version = project->first("TARGET_VERSION_EXT");
if(project->isActiveConfig("shared")) {
project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".exp");
}
@@ -314,7 +314,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
source_directories.insert(".", (void*)1);
static const char * const directories[] = { "UI_SOURCES_DIR", "UI_DIR", 0 };
for (int y = 0; directories[y]; y++) {
- QString dirTemp = project->first(directories[y]);
+ QString dirTemp = project->first(directories[y]).toQString();
if (dirTemp.endsWith("\\"))
dirTemp.truncate(dirTemp.length()-1);
if(!dirTemp.isEmpty())
@@ -322,12 +322,12 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
}
static const char * const srcs[] = { "SOURCES", "GENERATED_SOURCES", 0 };
for (int x = 0; srcs[x]; x++) {
- const QStringList &l = project->values(srcs[x]);
- for (QStringList::ConstIterator sit = l.begin(); sit != l.end(); ++sit) {
+ const ProStringList &l = project->values(srcs[x]);
+ for (ProStringList::ConstIterator sit = l.begin(); sit != l.end(); ++sit) {
QString sep = "\\";
if((*sit).indexOf(sep) == -1)
sep = "/";
- QString dir = (*sit).section(sep, 0, -2);
+ QString dir = (*sit).toQString().section(sep, 0, -2);
if(!dir.isEmpty() && !source_directories[dir])
source_directories.insert(dir, (void*)1);
}
@@ -357,7 +357,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
- const QString templateName = project->first("TEMPLATE");
+ const ProString templateName = project->first("TEMPLATE");
t << "first: all" << endl;
t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)" << endl << endl;
@@ -377,7 +377,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if (embedManifest) {
bool generateManifest = false;
const QString target = var("DEST_TARGET");
- QString manifest = project->first("QMAKE_MANIFEST");
+ QString manifest = project->first("QMAKE_MANIFEST").toQString();
QString extraLFlags;
if (manifest.isEmpty()) {
generateManifest = true;
@@ -386,7 +386,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
project->values("QMAKE_CLEAN") << manifest;
}
- const bool incrementalLinking = project->values("QMAKE_LFLAGS").filter(QRegExp("(/|-)INCREMENTAL:NO")).isEmpty();
+ const bool incrementalLinking = project->values("QMAKE_LFLAGS").toQStringList().filter(QRegExp("(/|-)INCREMENTAL:NO")).isEmpty();
if (incrementalLinking) {
// Link a resource that contains the manifest without modifying the exe/dll after linking.
diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h
index ce8c866adb..e6664dbb14 100644
--- a/qmake/generators/win32/msvc_nmake.h
+++ b/qmake/generators/win32/msvc_nmake.h
@@ -62,7 +62,7 @@ protected:
virtual QString getPdbTarget();
virtual QString defaultInstall(const QString &t);
virtual QStringList &findDependencies(const QString &file);
- QString var(const QString &value);
+ QString var(const ProKey &value);
QString precompH, precompObj, precompPch;
bool usePCH;
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index daaef0fbc4..19a0c53d5a 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2093,6 +2093,12 @@ void VCFilter::addFiles(const QStringList& fileList)
addFile(fileList.at(i));
}
+void VCFilter::addFiles(const ProStringList& fileList)
+{
+ for (int i = 0; i < fileList.count(); ++i)
+ addFile(fileList.at(i).toQString());
+}
+
void VCFilter::modifyPCHstage(QString str)
{
bool autogenSourceFile = Project->autogenPrecompCPP;
@@ -2180,12 +2186,12 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
continue;
// All information about the extra compiler
- QString tmp_out = Project->project->first(extraCompilerName + ".output");
- QString tmp_cmd = Project->project->values(extraCompilerName + ".commands").join(" ");
- QString tmp_cmd_name = Project->project->values(extraCompilerName + ".name").join(" ");
- QStringList tmp_dep = Project->project->values(extraCompilerName + ".depends");
- QString tmp_dep_cmd = Project->project->values(extraCompilerName + ".depend_command").join(" ");
- QStringList configs = Project->project->values(extraCompilerName + ".CONFIG");
+ QString tmp_out = Project->project->first(ProKey(extraCompilerName + ".output")).toQString();
+ QString tmp_cmd = Project->project->values(ProKey(extraCompilerName + ".commands")).join(" ");
+ QString tmp_cmd_name = Project->project->values(ProKey(extraCompilerName + ".name")).join(" ");
+ QStringList tmp_dep = Project->project->values(ProKey(extraCompilerName + ".depends")).toQStringList();
+ QString tmp_dep_cmd = Project->project->values(ProKey(extraCompilerName + ".depend_command")).join(" ");
+ const ProStringList &configs = Project->project->values(ProKey(extraCompilerName + ".CONFIG"));
bool combined = configs.indexOf("combine") != -1;
QString cmd, cmd_name, out;
@@ -2248,12 +2254,13 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
// Command for file
if (combined) {
// Add dependencies for each file
- QStringList tmp_in = Project->project->values(extraCompilerName + ".input");
+ const ProStringList &tmp_in = Project->project->values(ProKey(extraCompilerName + ".input"));
for (int a = 0; a < tmp_in.count(); ++a) {
- const QStringList &files = Project->project->values(tmp_in.at(a));
+ const ProStringList &files = Project->project->values(tmp_in.at(a).toKey());
for (int b = 0; b < files.count(); ++b) {
- deps += Project->findDependencies(files.at(b));
- inputs += Option::fixPathToTargetOS(files.at(b), false);
+ QString file = files.at(b).toQString();
+ deps += Project->findDependencies(file);
+ inputs += Option::fixPathToTargetOS(file, false);
}
}
deps += inputs; // input files themselves too..
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 4c55408a52..5d2cb74ed0 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -44,6 +44,9 @@
#include "project.h"
#include "xmloutput.h"
+
+#include <proitems.h>
+
#include <qatomic.h>
#include <qlist.h>
#include <qstring.h>
@@ -475,8 +478,8 @@ protected:
virtual ~VCToolBase(){}
virtual bool parseOption(const char* option) = 0;
public:
- void parseOptions(const QStringList& options) {
- for (QStringList::ConstIterator it=options.begin(); (it!=options.end()); it++)
+ void parseOptions(const ProStringList& options) {
+ for (ProStringList::ConstIterator it=options.begin(); (it!=options.end()); it++)
parseOption((*it).toLatin1().constData());
}
static QStringList fixCommandLine(const QString &input);
@@ -916,6 +919,7 @@ public:
void addFile(const QString& filename);
void addFile(const VCFilterFile& fileInfo);
void addFiles(const QStringList& fileList);
+ void addFiles(const ProStringList& fileList);
bool addExtraCompiler(const VCFilterFile &info);
void modifyPCHstage(QString str);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 9ca91f01c5..b27b638d42 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -282,10 +282,10 @@ bool VcprojGenerator::writeProjectMakefile()
mergedProjects.at(0)->vcProject.Name ==
mergedProjects.at(1)->vcProject.Name)
mergedProjects.at(0)->writePrlFile();
- mergedProject.Name = project->first("QMAKE_PROJECT_NAME");
+ mergedProject.Name = project->first("QMAKE_PROJECT_NAME").toQString();
mergedProject.Version = mergedProjects.at(0)->vcProject.Version;
- mergedProject.ProjectGUID = project->isEmpty("QMAKE_UUID") ? getProjectUUID().toString().toUpper() : project->first("QMAKE_UUID");
- mergedProject.Keyword = project->first("VCPROJ_KEYWORD");
+ mergedProject.ProjectGUID = project->isEmpty("QMAKE_UUID") ? getProjectUUID().toString().toUpper() : project->first("QMAKE_UUID").toQString();
+ mergedProject.Keyword = project->first("VCPROJ_KEYWORD").toQString();
mergedProject.SccProjectName = mergedProjects.at(0)->vcProject.SccProjectName;
mergedProject.SccLocalPath = mergedProjects.at(0)->vcProject.SccLocalPath;
mergedProject.PlatformName = mergedProjects.at(0)->vcProject.PlatformName;
@@ -321,11 +321,11 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename)
bool validUUID = true;
// Read GUID from variable-space
- QUuid uuid = project->first("GUID");
+ QUuid uuid = project->first("GUID").toQString();
// If none, create one based on the MD5 of absolute project path
if(uuid.isNull() || !filename.isEmpty()) {
- QString abspath = Option::fixPathToLocalOS(filename.isEmpty()?project->first("QMAKE_MAKEFILE"):filename);
+ QString abspath = Option::fixPathToLocalOS(filename.isEmpty()?project->first("QMAKE_MAKEFILE").toQString():filename);
QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Md5);
memcpy((unsigned char*)(&uuid), digest.constData(), sizeof(QUuid));
validUUID = !uuid.isNull();
@@ -342,7 +342,7 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename)
}
// Store GUID in variable-space
- project->values("GUID") = QStringList(uuid.toString().toUpper());
+ project->values("GUID") = ProStringList(uuid.toString().toUpper());
return uuid;
}
@@ -379,24 +379,26 @@ QUuid VcprojGenerator::increaseUUID(const QUuid &id)
QStringList VcprojGenerator::collectSubDirs(QMakeProject *proj)
{
QStringList subdirs;
- QStringList tmp_proj_subdirs = proj->values("SUBDIRS");
+ const ProStringList &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");
+ ProString tmpdir = tmp_proj_subdirs.at(x);
+ const ProKey tmpdirConfig(tmpdir + ".CONFIG");
if (!proj->isEmpty(tmpdirConfig)) {
- const QStringList config = proj->values(tmpdirConfig);
+ const ProStringList config = proj->values(tmpdirConfig);
if (config.contains(QStringLiteral("no_default_target")))
continue; // Ignore this sub-dir
}
- if(!proj->isEmpty(tmpdir + ".file")) {
- if(!proj->isEmpty(tmpdir + ".subdir"))
+ const ProKey fkey(tmpdir + ".file");
+ const ProKey skey(tmpdir + ".subdir");
+ if (!proj->isEmpty(fkey)) {
+ if (!proj->isEmpty(skey))
warn_msg(WarnLogic, "Cannot assign both file and subdir for subdir %s",
tmpdir.toLatin1().constData());
- tmpdir = proj->first(tmpdir + ".file");
- } else if(!proj->isEmpty(tmpdir + ".subdir")) {
- tmpdir = proj->first(tmpdir + ".subdir");
+ tmpdir = proj->first(fkey);
+ } else if (!proj->isEmpty(skey)) {
+ tmpdir = proj->first(skey);
}
- subdirs += tmpdir;
+ subdirs += tmpdir.toQString();
}
return subdirs;
}
@@ -516,10 +518,10 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
VcsolutionDepend *newDep = new VcsolutionDepend;
newDep->vcprojFile = vcprojDir + Option::dir_sep + vcproj;
- newDep->orig_target = unescapeFilePath(tmp_proj.first("QMAKE_ORIG_TARGET"));
- newDep->target = tmp_proj.first("MSVCPROJ_TARGET").section(Option::dir_sep, -1);
+ newDep->orig_target = unescapeFilePath(tmp_proj.first("QMAKE_ORIG_TARGET").toQString());
+ newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1);
newDep->targetType = tmp_vcproj.projectTarget;
- newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID");
+ newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString();
// We want to store it as the .lib name.
if(newDep->target.endsWith(".dll"))
@@ -530,13 +532,13 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
newDep->dependencies << "idc.exe";
// All extra compilers which has valid input are considered dependencies
- const QStringList &quc = tmp_proj.values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.constBegin(); it != quc.constEnd(); ++it) {
- const QStringList &invar = tmp_proj.values(*it + ".input");
- for(QStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
- const QStringList fileList = tmp_proj.values(*iit);
+ const ProStringList &quc = tmp_proj.values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.constBegin(); it != quc.constEnd(); ++it) {
+ const ProStringList &invar = tmp_proj.values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
+ const ProStringList &fileList = tmp_proj.values((*iit).toKey());
if (!fileList.isEmpty()) {
- const QStringList &cmdsParts = tmp_proj.values(*it + ".commands");
+ const QStringList &cmdsParts = tmp_proj.values(ProKey(*it + ".commands")).toQStringList();
bool startOfLine = true;
foreach(QString cmd, cmdsParts) {
if (!startOfLine) {
@@ -563,14 +565,14 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
// Add all unknown libs to the deps
- QStringList where = QStringList() << "QMAKE_LIBS" << "QMAKE_LIBS_PRIVATE";
+ ProStringList where = ProStringList() << "QMAKE_LIBS" << "QMAKE_LIBS_PRIVATE";
if(!tmp_proj.isEmpty("QMAKE_INTERNAL_PRL_LIBS"))
where = tmp_proj.values("QMAKE_INTERNAL_PRL_LIBS");
- for (QStringList::ConstIterator wit = where.begin();
+ for (ProStringList::ConstIterator wit = where.begin();
wit != where.end(); ++wit) {
- const QStringList &l = tmp_proj.values(*wit);
- for (QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- QString opt = (*it);
+ const ProStringList &l = tmp_proj.values((*wit).toKey());
+ for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
+ QString opt = (*it).toQString();
if(!opt.startsWith("/") && // Not a switch
opt != newDep->target && // Not self
opt != "opengl32.lib" && // We don't care about these libs
@@ -700,7 +702,7 @@ void VcprojGenerator::init()
processVars();
if(!project->values("VERSION").isEmpty()) {
- QString version = project->values("VERSION")[0];
+ QString version = project->values("VERSION")[0].toQString();
int firstDot = version.indexOf(".");
QString major = version.left(firstDot);
QString minor = version.right(version.length() - firstDot - 1);
@@ -724,21 +726,21 @@ void VcprojGenerator::init()
}
// Setup PCH variables
- precompH = project->first("PRECOMPILED_HEADER");
- precompCPP = project->first("PRECOMPILED_SOURCE");
+ precompH = project->first("PRECOMPILED_HEADER").toQString();
+ precompCPP = project->first("PRECOMPILED_SOURCE").toQString();
usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header");
if (usePCH) {
precompHFilename = fileInfo(precompH).fileName();
// Created files
- QString origTarget = unescapeFilePath(project->first("QMAKE_ORIG_TARGET"));
+ QString origTarget = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString());
precompObj = origTarget + Option::obj_ext;
precompPch = origTarget + ".pch";
// Add PRECOMPILED_HEADER to HEADERS
if (!project->values("HEADERS").contains(precompH))
project->values("HEADERS") += precompH;
// Return to variable pool
- project->values("PRECOMPILED_OBJECT") = QStringList(precompObj);
- project->values("PRECOMPILED_PCH") = QStringList(precompPch);
+ project->values("PRECOMPILED_OBJECT") = ProStringList(precompObj);
+ project->values("PRECOMPILED_PCH") = ProStringList(precompPch);
autogenPrecompCPP = precompCPP.isEmpty() && project->isActiveConfig("autogen_precompile_source");
if (autogenPrecompCPP) {
@@ -752,24 +754,23 @@ void VcprojGenerator::init()
// Add all input files for a custom compiler into a map for uniqueness,
// 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->values(*it + ".input");
- const QString compiler_out = project->first((*it) + ".output");
- for(QStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
- QStringList fileList = project->values(*iit);
+ foreach (const ProString &quc, project->values("QMAKE_EXTRA_COMPILERS")) {
+ const ProStringList &invar = project->values(ProKey(quc + ".input"));
+ const QString compiler_out = project->first(ProKey(quc + ".output")).toQString();
+ for (ProStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) {
+ ProStringList fileList = project->values((*iit).toKey());
if (!fileList.isEmpty()) {
- if (project->values((*it) + ".CONFIG").indexOf("combine") != -1)
- fileList = QStringList(fileList.first());
- for(QStringList::ConstIterator fit = fileList.constBegin(); fit != fileList.constEnd(); ++fit) {
- QString file = (*fit);
- if (verifyExtraCompiler((*it), file)) {
+ if (project->values(ProKey(quc + ".CONFIG")).indexOf("combine") != -1)
+ fileList.erase(fileList.begin() + 1, fileList.end());
+ for (ProStringList::ConstIterator fit = fileList.constBegin(); fit != fileList.constEnd(); ++fit) {
+ QString file = (*fit).toQString();
+ if (verifyExtraCompiler(quc, file)) {
if (!hasBuiltinCompiler(file)) {
- extraCompilerSources[file] += *it;
+ extraCompilerSources[file] += quc.toQString();
} else {
QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(
compiler_out, file, QString()), false);
- extraCompilerSources[out] += *it;
+ extraCompilerSources[out] += quc.toQString();
extraCompilerOutputs[out] = QStringList(file); // Can only have one
}
}
@@ -822,7 +823,7 @@ void VcprojGenerator::initProject()
initExtraCompilerOutputs();
// Own elements -----------------------------
- vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET"));
+ vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString());
switch(which_dotnet_version()) {
case NET2010:
vcProject.Version = "10.00";
@@ -847,15 +848,15 @@ void VcprojGenerator::initProject()
break;
}
- vcProject.Keyword = project->first("VCPROJ_KEYWORD");
+ vcProject.Keyword = project->first("VCPROJ_KEYWORD").toQString();
if (project->isHostBuild() || project->isEmpty("CE_SDK") || project->isEmpty("CE_ARCH")) {
vcProject.PlatformName = (is64Bit ? "x64" : "Win32");
} else {
vcProject.PlatformName = project->values("CE_SDK").join(" ") + " (" + project->first("CE_ARCH") + ")";
}
// These are not used by Qt, but may be used by customers
- vcProject.SccProjectName = project->first("SCCPROJECTNAME");
- vcProject.SccLocalPath = project->first("SCCLOCALPATH");
+ vcProject.SccProjectName = project->first("SCCPROJECTNAME").toQString();
+ vcProject.SccLocalPath = project->first("SCCLOCALPATH").toQString();
vcProject.flat_files = project->isActiveConfig("flat");
}
@@ -882,7 +883,7 @@ void VcprojGenerator::initConfiguration()
initIDLTool();
// Own elements -----------------------------
- QString temp = project->first("BuildBrowserInformation");
+ ProString temp = project->first("BuildBrowserInformation");
switch (projectTarget) {
case SharedLib:
conf.ConfigurationType = typeDynamicLibrary;
@@ -896,17 +897,17 @@ void VcprojGenerator::initConfiguration()
break;
}
- conf.OutputDirectory = project->first("DESTDIR");
+ conf.OutputDirectory = project->first("DESTDIR").toQString();
if (conf.OutputDirectory.isEmpty())
conf.OutputDirectory = ".\\";
if (!conf.OutputDirectory.endsWith("\\"))
conf.OutputDirectory += '\\';
if (conf.CompilerVersion >= NET2010) {
// The target name could have been changed.
- conf.PrimaryOutput = project->first("TARGET");
+ conf.PrimaryOutput = project->first("TARGET").toQString();
if ( !conf.PrimaryOutput.isEmpty() && !project->first("TARGET_VERSION_EXT").isEmpty() && project->isActiveConfig("shared"))
- conf.PrimaryOutput.append(project->first("TARGET_VERSION_EXT"));
- conf.PrimaryOutputExtension = project->first("TARGET_EXT");
+ conf.PrimaryOutput.append(project->first("TARGET_VERSION_EXT").toQString());
+ conf.PrimaryOutputExtension = project->first("TARGET_EXT").toQString();
}
conf.Name = project->values("BUILD_NAME").join(" ");
@@ -922,9 +923,9 @@ void VcprojGenerator::initConfiguration()
conf.BuildBrowserInformation = triState(temp.isEmpty() ? (short)unset : temp.toShort());
temp = project->first("CharacterSet");
conf.CharacterSet = charSet(temp.isEmpty() ? (short)charSetNotSet : temp.toShort());
- conf.DeleteExtensionsOnClean = project->first("DeleteExtensionsOnClean");
+ conf.DeleteExtensionsOnClean = project->first("DeleteExtensionsOnClean").toQString();
conf.ImportLibrary = conf.linker.ImportLibrary;
- conf.IntermediateDirectory = project->first("OBJECTS_DIR");
+ conf.IntermediateDirectory = project->first("OBJECTS_DIR").toQString();
conf.WholeProgramOptimization = conf.compiler.WholeProgramOptimization;
temp = project->first("UseOfATL");
if(!temp.isEmpty())
@@ -953,7 +954,7 @@ void VcprojGenerator::initConfiguration()
void VcprojGenerator::initCompilerTool()
{
- QString placement = project->first("OBJECTS_DIR");
+ QString placement = project->first("OBJECTS_DIR").toQString();
if(placement.isEmpty())
placement = ".\\";
@@ -970,8 +971,8 @@ void VcprojGenerator::initCompilerTool()
if (usePCH) {
conf.compiler.UsePrecompiledHeader = pchUseUsingSpecific;
conf.compiler.PrecompiledHeaderFile = "$(IntDir)\\" + precompPch;
- conf.compiler.PrecompiledHeaderThrough = project->first("PRECOMPILED_HEADER");
- conf.compiler.ForcedIncludeFiles = project->values("PRECOMPILED_HEADER");
+ conf.compiler.PrecompiledHeaderThrough = project->first("PRECOMPILED_HEADER").toQString();
+ conf.compiler.ForcedIncludeFiles = project->values("PRECOMPILED_HEADER").toQStringList();
if (conf.CompilerVersion <= NET2003) {
// Minimal build option triggers an Internal Compiler Error
@@ -991,8 +992,8 @@ void VcprojGenerator::initCompilerTool()
else if (project->isActiveConfig("console"))
conf.compiler.PreprocessorDefinitions += "_CONSOLE";
- conf.compiler.PreprocessorDefinitions += project->values("DEFINES");
- conf.compiler.PreprocessorDefinitions += project->values("PRL_EXPORT_DEFINES");
+ conf.compiler.PreprocessorDefinitions += project->values("DEFINES").toQStringList();
+ conf.compiler.PreprocessorDefinitions += project->values("PRL_EXPORT_DEFINES").toQStringList();
conf.compiler.parseOptions(project->values("MSVCPROJ_INCPATH"));
}
@@ -1000,8 +1001,8 @@ void VcprojGenerator::initLibrarianTool()
{
VCConfiguration &conf = vcProject.Configuration;
conf.librarian.OutputFile = "$(OutDir)\\";
- conf.librarian.OutputFile += project->first("MSVCPROJ_TARGET");
- conf.librarian.AdditionalOptions += project->values("QMAKE_LIBFLAGS");
+ conf.librarian.OutputFile += project->first("MSVCPROJ_TARGET").toQString();
+ conf.librarian.AdditionalOptions += project->values("QMAKE_LIBFLAGS").toQStringList();
}
void VcprojGenerator::initLinkerTool()
@@ -1010,19 +1011,19 @@ void VcprojGenerator::initLinkerTool()
conf.linker.parseOptions(project->values("QMAKE_LFLAGS"));
if (!project->values("DEF_FILE").isEmpty())
- conf.linker.ModuleDefinitionFile = project->first("DEF_FILE");
+ conf.linker.ModuleDefinitionFile = project->first("DEF_FILE").toQString();
- foreach (QString libs, project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE")) {
- if (libs.left(9).toUpper() == "/LIBPATH:") {
- QStringList l = QStringList(libs);
+ foreach (const ProString &libs, project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE")) {
+ if (libs.left(9).toQString().toUpper() == "/LIBPATH:") {
+ ProStringList l = ProStringList(libs);
conf.linker.parseOptions(l);
} else {
- conf.linker.AdditionalDependencies += libs;
+ conf.linker.AdditionalDependencies += libs.toQString();
}
}
conf.linker.OutputFile = "$(OutDir)\\";
- conf.linker.OutputFile += project->first("MSVCPROJ_TARGET");
+ conf.linker.OutputFile += project->first("MSVCPROJ_TARGET").toQString();
if(project->isActiveConfig("dll")){
conf.linker.parseOptions(project->values("QMAKE_LFLAGS_QT_DLL"));
@@ -1095,10 +1096,10 @@ void VcprojGenerator::initDeploymentTool()
// FIXME: This code should actually resolve the libraries from all Qt modules.
const QString &qtdir = QLibraryInfo::rawLocation(QLibraryInfo::LibrariesPath,
QLibraryInfo::EffectivePaths);
- QStringList arg = project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE");
- for (QStringList::ConstIterator it = arg.constBegin(); it != arg.constEnd(); ++it) {
+ ProStringList arg = project->values("QMAKE_LIBS") + project->values("QMAKE_LIBS_PRIVATE");
+ for (ProStringList::ConstIterator it = arg.constBegin(); it != arg.constEnd(); ++it) {
if (it->contains(qtdir)) {
- QString dllName = *it;
+ QString dllName = (*it).toQString();
if (dllName.contains(QLatin1String("QAxContainer"))
|| dllName.contains(QLatin1String("qtmain"))
@@ -1118,7 +1119,7 @@ void VcprojGenerator::initDeploymentTool()
QString runtime = project->values("QT_CE_C_RUNTIME").join(QLatin1String(" "));
if (!runtime.isEmpty() && (runtime != QLatin1String("no"))) {
QString runtimeVersion = QLatin1String("msvcr");
- QString mkspec = project->first("QMAKESPEC");
+ ProString mkspec = project->first("QMAKESPEC");
if (!mkspec.isEmpty()) {
if (mkspec.endsWith("2008"))
@@ -1152,9 +1153,9 @@ void VcprojGenerator::initDeploymentTool()
}
// foreach item in DEPLOYMENT
- foreach(QString item, project->values("DEPLOYMENT")) {
+ foreach (const ProString &item, project->values("DEPLOYMENT")) {
// get item.path
- QString devicePath = project->first(item + ".path");
+ QString devicePath = project->first(ProKey(item + ".path")).toQString();
if (devicePath.isEmpty())
devicePath = targetPath;
// check if item.path is relative (! either /,\ or %)
@@ -1165,9 +1166,9 @@ void VcprojGenerator::initDeploymentTool()
devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath));
}
// foreach d in item.files
- foreach (QString source, project->values(item + ".files")) {
+ foreach (const ProString &src, project->values(ProKey(item + ".files"))) {
QString itemDevicePath = devicePath;
- source = Option::fixPathToLocalOS(source);
+ QString source = Option::fixPathToLocalOS(src.toQString());
QString nameFilter;
QFileInfo info(source);
QString searchPath;
@@ -1324,12 +1325,12 @@ void VcprojGenerator::initResourceFiles()
// Bad hack, please look away -------------------------------------
QString rcc_dep_cmd = project->values("rcc.depend_command").join(" ");
if(!rcc_dep_cmd.isEmpty()) {
- QStringList qrc_files = project->values("RESOURCES");
+ ProStringList qrc_files = project->values("RESOURCES");
QStringList deps;
if(!qrc_files.isEmpty()) {
for (int i = 0; i < qrc_files.count(); ++i) {
char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(rcc_dep_cmd, qrc_files.at(i),"");
+ QString dep_cmd = replaceExtraCompilerVariables(rcc_dep_cmd, qrc_files.at(i).toQString(), "");
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(canExecute(dep_cmd)) {
@@ -1366,7 +1367,7 @@ void VcprojGenerator::initResourceFiles()
void VcprojGenerator::initExtraCompilerOutputs()
{
- QStringList otherFilters;
+ ProStringList otherFilters;
otherFilters << "FORMS"
<< "FORMS3"
<< "GENERATED_FILES"
@@ -1382,15 +1383,15 @@ void VcprojGenerator::initExtraCompilerOutputs()
<< "SOURCES"
<< "TRANSLATIONS"
<< "YACCSOURCES";
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- QString extracompilerName = project->first((*it) + ".name");
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ ProString extracompilerName = project->first(ProKey(*it + ".name"));
if (extracompilerName.isEmpty())
extracompilerName = (*it);
// Create an extra compiler filter and add the files
VCFilter extraCompile;
- extraCompile.Name = extracompilerName;
+ extraCompile.Name = extracompilerName.toQString();
extraCompile.ParseFiles = _False;
extraCompile.Filter = "";
extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it);
@@ -1398,22 +1399,22 @@ void VcprojGenerator::initExtraCompilerOutputs()
// If the extra compiler has a variable_out set the output file
// is added to an other file list, and does not need its own..
- bool addOnInput = hasBuiltinCompiler(project->first((*it) + ".output"));
- QString tmp_other_out = project->first((*it) + ".variable_out");
+ bool addOnInput = hasBuiltinCompiler(project->first(ProKey(*it + ".output")).toQString());
+ const ProString &tmp_other_out = project->first(ProKey(*it + ".variable_out"));
if (!tmp_other_out.isEmpty() && !addOnInput)
continue;
if (!addOnInput) {
- QString tmp_out = project->first((*it) + ".output");
- if (project->values((*it) + ".CONFIG").indexOf("combine") != -1) {
+ QString tmp_out = project->first(ProKey(*it + ".output")).toQString();
+ if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
// Combined output, only one file result
extraCompile.addFile(
Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, QString(), QString()), false));
} else {
// One output file per input
- QStringList tmp_in = project->values(project->first((*it) + ".input"));
+ const ProStringList &tmp_in = project->values(project->first(ProKey(*it + ".input")).toKey());
for (int i = 0; i < tmp_in.count(); ++i) {
- const QString &filename = tmp_in.at(i);
+ const QString &filename = tmp_in.at(i).toQString();
if (extraCompilerSources.contains(filename))
extraCompile.addFile(
Option::fixPathToTargetOS(replaceExtraCompilerVariables(filename, tmp_out, QString()), false));
@@ -1424,12 +1425,12 @@ void VcprojGenerator::initExtraCompilerOutputs()
// build steps there. So, we turn it around and add it to the input files instead,
// provided that the input file variable is not handled already (those in otherFilters
// are handled, so we avoid them).
- QStringList inputVars = project->values((*it) + ".input");
- foreach(QString inputVar, inputVars) {
+ const ProStringList &inputVars = project->values(ProKey(*it + ".input"));
+ foreach (const ProString &inputVar, inputVars) {
if (!otherFilters.contains(inputVar)) {
- QStringList tmp_in = project->values(inputVar);
+ const ProStringList &tmp_in = project->values(inputVar.toKey());
for (int i = 0; i < tmp_in.count(); ++i) {
- const QString &filename = tmp_in.at(i);
+ const QString &filename = tmp_in.at(i).toQString();
if (extraCompilerSources.contains(filename))
extraCompile.addFile(
Option::fixPathToTargetOS(replaceExtraCompilerVariables(filename, QString(), QString()), false));
@@ -1448,23 +1449,23 @@ void VcprojGenerator::initExtraCompilerOutputs()
void VcprojGenerator::initOld()
{
// $$QMAKE.. -> $$MSVCPROJ.. -------------------------------------
- const QStringList &incs = project->values("INCLUDEPATH");
- for (QStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
- QString inc = (*incit);
+ const ProStringList &incs = project->values("INCLUDEPATH");
+ for (ProStringList::ConstIterator incit = incs.begin(); incit != incs.end(); ++incit) {
+ QString inc = (*incit).toQString();
if (!inc.startsWith('"') && !inc.endsWith('"'))
inc = QString("\"%1\"").arg(inc); // Quote all paths if not quoted already
project->values("MSVCPROJ_INCPATH").append("-I" + inc);
}
project->values("MSVCPROJ_INCPATH").append("-I" + specdir());
- QString dest = Option::fixPathToTargetOS(project->first("TARGET")) + project->first("TARGET_EXT");
- project->values("MSVCPROJ_TARGET") = QStringList(dest);
+ QString dest = Option::fixPathToTargetOS(project->first("TARGET").toQString()) + project->first("TARGET_EXT");
+ project->values("MSVCPROJ_TARGET") = ProStringList(dest);
// DLL COPY ------------------------------------------------------
if(project->isActiveConfig("dll") && !project->values("DLLDESTDIR").isEmpty()) {
- QStringList dlldirs = project->values("DLLDESTDIR");
+ const ProStringList &dlldirs = project->values("DLLDESTDIR");
QString copydll("");
- QStringList::Iterator dlldir;
+ ProStringList::ConstIterator dlldir;
for(dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
if(!copydll.isEmpty())
copydll += " && ";
@@ -1499,13 +1500,13 @@ QString VcprojGenerator::replaceExtraCompilerVariables(const QString &var, const
{
QString ret = MakefileGenerator::replaceExtraCompilerVariables(var, in, out);
- QStringList &defines = project->values("VCPROJ_MAKEFILE_DEFINES");
+ ProStringList &defines = project->values("VCPROJ_MAKEFILE_DEFINES");
if(defines.isEmpty())
defines.append(varGlue("PRL_EXPORT_DEFINES"," -D"," -D","") +
varGlue("DEFINES"," -D"," -D",""));
- ret.replace("$(DEFINES)", defines.first());
+ ret.replace("$(DEFINES)", defines.first().toQString());
- QStringList &incpath = project->values("VCPROJ_MAKEFILE_INCPATH");
+ ProStringList &incpath = project->values("VCPROJ_MAKEFILE_INCPATH");
if(incpath.isEmpty() && !this->var("MSVCPROJ_INCPATH").isEmpty())
incpath.append(this->var("MSVCPROJ_INCPATH"));
ret.replace("$(INCPATH)", incpath.join(" "));
@@ -1522,10 +1523,10 @@ bool VcprojGenerator::openOutput(QFile &file, const QString &/*build*/) const
outdir = file.fileName() + QDir::separator();
}
if(!outdir.isEmpty() || file.fileName().isEmpty()) {
- QString ext = project->first("VCPROJ_EXTENSION");
+ ProString ext = project->first("VCPROJ_EXTENSION");
if(project->first("TEMPLATE") == "vcsubdirs")
ext = project->first("VCSOLUTION_EXTENSION");
- QString outputName = unescapeFilePath(project->first("TARGET"));
+ ProString outputName = unescapeFilePath(project->first("TARGET"));
if (!project->first("MAKEFILE").isEmpty())
outputName = project->first("MAKEFILE");
file.setFileName(outdir + outputName + ext);
@@ -1553,8 +1554,8 @@ void VcprojGenerator::outputVariables()
{
#if 0
qDebug("Generator: MSVC.NET: List of current variables:");
- for(QHash<QString, QStringList>::ConstIterator it = project->variables().begin(); it != project->variables().end(); ++it)
- qDebug("Generator: MSVC.NET: %s => %s", qPrintable(it.key()), qPrintable(it.value().join(" | ")));
+ for (ProValueMap::ConstIterator it = project->variables().begin(); it != project->variables().end(); ++it)
+ qDebug("Generator: MSVC.NET: %s => %s", qPrintable(it.key().toQString()), qPrintable(it.value().join(" | ")));
#endif
}
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index b3c998bb53..c4d5787949 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -72,8 +72,9 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
if (libInfoRead && libinfo.values("QMAKE_PRL_CONFIG").contains("staticlib"))
return -1;
- if(!project->values("QMAKE_" + stem.toUpper() + "_VERSION_OVERRIDE").isEmpty())
- return project->values("QMAKE_" + stem.toUpper() + "_VERSION_OVERRIDE").first().toInt();
+ const ProStringList &vover = project->values(ProKey("QMAKE_" + stem.toUpper() + "_VERSION_OVERRIDE"));
+ if (!vover.isEmpty())
+ return vover.first().toInt();
int biggest=-1;
if(!project->isActiveConfig("no_versionlink")) {
@@ -99,7 +100,7 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
if(libInfoRead
&& !libinfo.values("QMAKE_PRL_CONFIG").contains("staticlib")
&& !libinfo.isEmpty("QMAKE_PRL_VERSION"))
- biggest = qMax(biggest, libinfo.first("QMAKE_PRL_VERSION").replace(".", "").toInt());
+ biggest = qMax(biggest, libinfo.first("QMAKE_PRL_VERSION").toQString().replace(".", "").toInt());
return biggest;
}
@@ -109,11 +110,11 @@ Win32MakefileGenerator::findLibraries()
QList<QMakeLocalFileName> dirs;
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
- QStringList &l = project->values(lflags[i]);
- for(QStringList::Iterator it = l.begin(); it != l.end();) {
+ ProStringList &l = project->values(lflags[i]);
+ for (ProStringList::Iterator it = l.begin(); it != l.end();) {
QChar quote;
bool modified_opt = false, remove = false;
- QString opt = (*it).trimmed();
+ QString opt = (*it).trimmed().toQString();
if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0]) {
quote = opt[0];
opt = opt.mid(1, opt.length()-2);
@@ -137,9 +138,7 @@ Win32MakefileGenerator::findLibraries()
} else if(opt.startsWith("-l") || opt.startsWith("/l")) {
QString lib = opt.right(opt.length() - 2), out;
if(!lib.isEmpty()) {
- QString suffix;
- if(!project->isEmpty("QMAKE_" + lib.toUpper() + "_SUFFIX"))
- suffix = project->first("QMAKE_" + lib.toUpper() + "_SUFFIX");
+ ProString suffix = project->first(ProKey("QMAKE_" + lib.toUpper() + "_SUFFIX"));
for(QList<QMakeLocalFileName>::Iterator it = dirs.begin();
it != dirs.end(); ++it) {
QString extension;
@@ -176,9 +175,7 @@ Win32MakefileGenerator::findLibraries()
if(file.endsWith(".lib")) {
file = file.left(file.length() - 4);
if(!file.at(file.length()-1).isNumber()) {
- QString suffix;
- if(!project->isEmpty("QMAKE_" + file.section(Option::dir_sep, -1).toUpper() + "_SUFFIX"))
- suffix = project->first("QMAKE_" + file.section(Option::dir_sep, -1).toUpper() + "_SUFFIX");
+ ProString suffix = project->first(ProKey("QMAKE_" + file.section(Option::dir_sep, -1).toUpper() + "_SUFFIX"));
for(QList<QMakeLocalFileName>::Iterator dep_it = lib_dirs.begin(); dep_it != lib_dirs.end(); ++dep_it) {
QString lib_tmpl(file + "%1" + suffix + ".lib");
int ver = findHighestVersion((*dep_it).local(), file);
@@ -216,13 +213,13 @@ Win32MakefileGenerator::findLibraries()
void
Win32MakefileGenerator::processPrlFiles()
{
- const QString libArg = project->first("QMAKE_L_FLAG");
+ const QString libArg = project->first("QMAKE_L_FLAG").toQString();
QList<QMakeLocalFileName> libdirs;
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
- QStringList &l = project->values(lflags[i]);
+ ProStringList &l = project->values(lflags[i]);
for (int lit = 0; lit < l.size(); ++lit) {
- QString opt = l.at(lit).trimmed();
+ QString opt = l.at(lit).trimmed().toQString();
if((opt[0] == '\'' || opt[0] == '"') && opt[(int)opt.length()-1] == opt[0])
opt = opt.mid(1, opt.length()-2);
if (opt.startsWith(libArg)) {
@@ -243,7 +240,7 @@ Win32MakefileGenerator::processPrlFiles()
}
}
}
- QStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
+ ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
for (int prl = 0; prl < prl_libs.size(); ++prl)
l.insert(lit + prl + 1, prl_libs.at(prl));
prl_libs.clear();
@@ -256,15 +253,15 @@ void Win32MakefileGenerator::processVars()
{
//If the TARGET looks like a path split it into DESTDIR and the resulting TARGET
if(!project->isEmpty("TARGET")) {
- QString targ = project->first("TARGET");
+ ProString targ = project->first("TARGET");
int slsh = qMax(targ.lastIndexOf('/'), targ.lastIndexOf(Option::dir_sep));
if(slsh != -1) {
if(project->isEmpty("DESTDIR"))
project->values("DESTDIR").append("");
else if(project->first("DESTDIR").right(1) != Option::dir_sep)
- project->values("DESTDIR") = QStringList(project->first("DESTDIR") + Option::dir_sep);
- project->values("DESTDIR") = QStringList(project->first("DESTDIR") + targ.left(slsh+1));
- project->values("TARGET") = QStringList(targ.mid(slsh+1));
+ project->values("DESTDIR") = ProStringList(project->first("DESTDIR") + Option::dir_sep);
+ project->values("DESTDIR") = ProStringList(project->first("DESTDIR") + targ.left(slsh+1));
+ project->values("TARGET") = ProStringList(targ.mid(slsh+1));
}
}
@@ -278,7 +275,7 @@ void Win32MakefileGenerator::processVars()
project->values("INCLUDEPATH") += project->values("QMAKE_INCDIR");
if (!project->values("VERSION").isEmpty()) {
- QStringList l = project->first("VERSION").split('.');
+ QStringList l = project->first("VERSION").toQString().split('.');
if (l.size() > 0)
project->values("VER_MAJ").append(l[0]);
if (l.size() > 1)
@@ -304,21 +301,21 @@ void Win32MakefileGenerator::processVars()
fixTargetExt();
processRcFileVar();
- QStringList &incDir = project->values("INCLUDEPATH");
- for(QStringList::Iterator incDir_it = incDir.begin(); incDir_it != incDir.end(); ++incDir_it) {
- if(!(*incDir_it).isEmpty())
- (*incDir_it) = Option::fixPathToTargetOS((*incDir_it), false, false);
- }
-
- QString libArg = project->first("QMAKE_L_FLAG");
- QStringList libs;
- QStringList &libDir = project->values("QMAKE_LIBDIR");
- for(QStringList::Iterator libDir_it = libDir.begin(); libDir_it != libDir.end(); ++libDir_it) {
- if (!(*libDir_it).isEmpty()) {
- (*libDir_it).remove("\"");
- if ((*libDir_it).endsWith("\\"))
- (*libDir_it).chop(1);
- libs << libArg + escapeFilePath(Option::fixPathToTargetOS((*libDir_it), false, false));
+ ProStringList &incDir = project->values("INCLUDEPATH");
+ for (ProStringList::Iterator incDir_it = incDir.begin(); incDir_it != incDir.end(); ++incDir_it)
+ if (!(*incDir_it).isEmpty())
+ (*incDir_it) = Option::fixPathToTargetOS((*incDir_it).toQString(), false, false);
+
+ ProString libArg = project->first("QMAKE_L_FLAG");
+ ProStringList libs;
+ ProStringList &libDir = project->values("QMAKE_LIBDIR");
+ for (ProStringList::Iterator libDir_it = libDir.begin(); libDir_it != libDir.end(); ++libDir_it) {
+ QString lib = (*libDir_it).toQString();
+ if (!lib.isEmpty()) {
+ lib.remove('"');
+ if (lib.endsWith('\\'))
+ lib.chop(1);
+ libs << libArg + escapeFilePath(Option::fixPathToTargetOS(lib, false, false));
}
}
project->values("QMAKE_LIBS") += libs + escapeFilePaths(project->values("LIBS"));
@@ -377,7 +374,7 @@ void Win32MakefileGenerator::processRcFileVar()
QByteArray rcString;
QTextStream ts(&rcString, QFile::WriteOnly);
- QStringList vers = project->values("VERSION").first().split(".");
+ QStringList vers = project->first("VERSION").toQString().split(".");
for (int i = vers.size(); i < 4; i++)
vers += "0";
QString versionString = vers.join(".");
@@ -398,7 +395,7 @@ void Win32MakefileGenerator::processRcFileVar()
if (!project->values("QMAKE_TARGET_PRODUCT").isEmpty())
productName = project->values("QMAKE_TARGET_PRODUCT").join(" ");
else
- productName = project->values("TARGET").first();
+ productName = project->first("TARGET").toQString();
QString originalName = project->values("TARGET").first() + project->values("TARGET_EXT").first();
int rcLang = project->intValue("RC_LANG", 1033); // default: English(USA)
@@ -494,7 +491,7 @@ void Win32MakefileGenerator::processRcFileVar()
fprintf(stderr, "Please specify one of them, not both.");
exit(1);
}
- QString resFile = project->values("RC_FILE").first();
+ QString resFile = project->first("RC_FILE").toQString();
// if this is a shadow build then use the absolute path of the rc file
if (Option::output_dir != qmake_getpwd()) {
@@ -507,13 +504,14 @@ void Win32MakefileGenerator::processRcFileVar()
if (!project->values("OBJECTS_DIR").isEmpty()) {
QString resDestDir;
if (project->isActiveConfig("staticlib"))
- resDestDir = fileInfo(project->first("DESTDIR")).absoluteFilePath();
+ resDestDir = fileInfo(project->first("DESTDIR").toQString()).absoluteFilePath();
else
- resDestDir = project->first("OBJECTS_DIR");
+ resDestDir = project->first("OBJECTS_DIR").toQString();
resDestDir.append(Option::dir_sep);
project->values("RES_FILE").first().prepend(resDestDir);
}
- project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false);
+ project->values("RES_FILE").first() = Option::fixPathToTargetOS(
+ project->values("RES_FILE").first().toQString(), false, false);
project->values("POST_TARGETDEPS") += project->values("RES_FILE");
project->values("CLEAN_FILES") += project->values("RES_FILE");
}
@@ -525,15 +523,15 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
{
const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 };
for(int i = 0; clean_targets[i]; ++i) {
- const QStringList &list = project->values(clean_targets[i]);
+ const ProStringList &list = project->values(clean_targets[i]);
const QString del_statement("-$(DEL_FILE)");
if(project->isActiveConfig("no_delete_multiple_files")) {
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
t << "\n\t" << del_statement << " " << escapeFilePath((*it));
} else {
QString files, file;
const int commandlineLimit = 2047; // NT limit, expanded
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
file = " " + escapeFilePath((*it));
if(del_statement.length() + files.length() +
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
@@ -553,17 +551,17 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
{
const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 };
for(int i = 0; clean_targets[i]; ++i) {
- const QStringList &list = project->values(clean_targets[i]);
+ const ProStringList &list = project->values(clean_targets[i]);
const QString del_statement("-$(DEL_FILE)");
if(project->isActiveConfig("no_delete_multiple_files")) {
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it)
t << "\n\t" << del_statement << " "
- << escapeFilePath(Option::fixPathToTargetOS(*it));
+ << escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
} else {
QString files, file;
const int commandlineLimit = 2047; // NT limit, expanded
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- file = " " + escapeFilePath(Option::fixPathToTargetOS(*it));
+ for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ file = " " + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
if(del_statement.length() + files.length() +
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
t << "\n\t" << del_statement << files;
@@ -589,9 +587,9 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
{
t << "INCPATH = ";
- const QStringList &incs = project->values("INCLUDEPATH");
+ const ProStringList &incs = project->values("INCLUDEPATH");
for(int i = 0; i < incs.size(); ++i) {
- QString inc = incs.at(i);
+ QString inc = incs.at(i).toQString();
inc.replace(QRegExp("\\\\$"), "");
inc.replace(QRegExp("\""), "");
if(!inc.isEmpty())
@@ -678,9 +676,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeBuildRulesPart(t);
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
- QStringList dlldirs = project->values("DLLDESTDIR");
- for (QStringList::Iterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
- t << "\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" " << Option::fixPathToTargetOS(*dlldir, false) << endl;
+ const ProStringList &dlldirs = project->values("DLLDESTDIR");
+ for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
+ t << "\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" "
+ << Option::fixPathToTargetOS((*dlldir).toQString(), false) << endl;
}
}
t << endl;
@@ -691,12 +690,12 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
QStringList dist_files = fileFixify(Option::mkfile::project_files);
if(!project->isEmpty("QMAKE_INTERNAL_INCLUDED_FILES"))
- dist_files += project->values("QMAKE_INTERNAL_INCLUDED_FILES");
+ dist_files += project->values("QMAKE_INTERNAL_INCLUDED_FILES").toQStringList();
if(!project->isEmpty("TRANSLATIONS"))
dist_files << var("TRANSLATIONS");
if(!project->isEmpty("FORMS")) {
- const QStringList &forms = project->values("FORMS");
- for (QStringList::ConstIterator formit = forms.begin(); formit != forms.end(); ++formit) {
+ const ProStringList &forms = project->values("FORMS");
+ for (ProStringList::ConstIterator formit = forms.begin(); formit != forms.end(); ++formit) {
QString ui_h = fileFixify((*formit) + Option::h_ext.first());
if(exists(ui_h))
dist_files << ui_h;
@@ -706,12 +705,11 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip " << "$(SOURCES) $(DIST) "
<< dist_files.join(" ") << " " << var("TRANSLATIONS") << " ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
- const QStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
- for(QStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
- const QStringList &inputs = project->values((*it)+".input");
- for(QStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
+ const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
+ for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
+ const ProStringList &inputs = project->values(ProKey(*it + ".input"));
+ for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input)
t << (*input) << " ";
- }
}
}
t << endl << endl;
@@ -760,8 +758,8 @@ void Win32MakefileGenerator::writeBuildRulesPart(QTextStream &)
void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
{
if(!project->values("RC_FILE").isEmpty()) {
- const QString res_file = project->first("RES_FILE"),
- rc_file = fileFixify(project->first("RC_FILE"));
+ const ProString res_file = project->first("RES_FILE");
+ const QString rc_file = fileFixify(project->first("RC_FILE").toQString());
// The resource tool needs to have the same defines passed in as the compiler, since you may
// use these defines in the .rc file itself. Also, we need to add the _DEBUG define manually
// since the compiler defines this symbol by itself, and we use it in the automatically
@@ -785,9 +783,9 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
return QString();
const QString root = "$(INSTALL_ROOT)";
- QStringList &uninst = project->values(t + ".uninstall");
+ ProStringList &uninst = project->values(ProKey(t + ".uninstall"));
QString ret;
- QString targetdir = Option::fixPathToTargetOS(project->first(t + ".path"), false);
+ QString targetdir = Option::fixPathToTargetOS(project->first(ProKey(t + ".path")).toQString(), false);
targetdir = fileFixify(targetdir, FileFixifyAbsolute);
if(targetdir.right(1) != Option::dir_sep)
targetdir += Option::dir_sep;
@@ -795,7 +793,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
if(t == "target" && project->first("TEMPLATE") == "lib") {
if(project->isActiveConfig("create_prl") && !project->isActiveConfig("no_install_prl") &&
!project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
- QString dst_prl = Option::fixPathToTargetOS(project->first("QMAKE_INTERNAL_PRL_FILE"));
+ QString dst_prl = Option::fixPathToTargetOS(project->first("QMAKE_INTERNAL_PRL_FILE").toQString());
int slsh = dst_prl.lastIndexOf(Option::dir_sep);
if(slsh != -1)
dst_prl = dst_prl.right(dst_prl.length() - slsh - 1);
@@ -817,17 +815,17 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
if(!ret.isEmpty())
ret += "\n\t";
- const QString replace_rule("QMAKE_PKGCONFIG_INSTALL_REPLACE");
+ const ProKey replace_rule("QMAKE_PKGCONFIG_INSTALL_REPLACE");
if (project->isEmpty(replace_rule)
|| project->isActiveConfig("no_sed_meta_install")
|| project->isEmpty("QMAKE_STREAM_EDITOR")) {
ret += "-$(INSTALL_FILE) \"" + pkgConfigFileName(true) + "\" \"" + dst_pc + "\"";
} else {
ret += "-$(SED)";
- QStringList replace_rules = project->values(replace_rule);
+ const ProStringList &replace_rules = project->values(replace_rule);
for (int r = 0; r < replace_rules.size(); ++r) {
- const QString match = project->first(replace_rules.at(r) + ".match"),
- replace = project->first(replace_rules.at(r) + ".replace");
+ const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
+ replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
if (!match.isEmpty() /*&& match != replace*/)
ret += " -e \"s," + match + "," + replace + ",g\"";
}
@@ -852,7 +850,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
}
- if(t == "dlltarget" || project->values(t + ".CONFIG").indexOf("no_dll") == -1) {
+ if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
QString src_targ = "$(DESTDIR_TARGET)";
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + "$(TARGET)", FileFixifyAbsolute));
if(!ret.isEmpty())
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index 930050ebd6..908f220e8a 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -61,6 +61,7 @@ protected:
virtual void writeImplicitRulesPart(QTextStream &t);
virtual void writeBuildRulesPart(QTextStream &);
virtual QString escapeFilePath(const QString &path) const;
+ ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); }
virtual void writeRcFilePart(QTextStream &t);
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
new file mode 100644
index 0000000000..994bfcc75d
--- /dev/null
+++ b/qmake/library/proitems.h
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the qmake application of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PROITEMS_H
+#define PROITEMS_H
+
+#include "qmake_global.h"
+
+#include <QString>
+#include <QStringList>
+#include <QHash>
+#include <QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+#if 0
+# define PROITEM_EXPLICIT explicit
+#else
+# define PROITEM_EXPLICIT
+#endif
+
+class ProKey;
+class ProStringList;
+
+class ProString {
+public:
+ ProString() {}
+ ProString(const ProString &other) : m_string(other.m_string) {}
+ PROITEM_EXPLICIT ProString(const QString &str) : m_string(str) {}
+ PROITEM_EXPLICIT ProString(const char *str) : m_string(QLatin1String(str)) {}
+ void clear() { m_string.clear(); }
+
+ ProString &prepend(const ProString &other) { m_string.prepend(other.m_string); return *this; }
+ ProString &append(const ProString &other) { m_string.append(other.m_string); return *this; }
+ ProString &append(const QString &other) { m_string.append(other); return *this; }
+ ProString &append(const char *other) { m_string.append(QLatin1String(other)); return *this; }
+ ProString &append(QChar other) { m_string.append(other); return *this; }
+ ProString &operator+=(const ProString &other) { return append(other); }
+ ProString &operator+=(const QString &other) { return append(other); }
+ ProString &operator+=(const char *other) { return append(other); }
+ ProString &operator+=(QChar other) { return append(other); }
+
+ void chop(int n) { m_string.chop(n); }
+ void chopFront(int n) { m_string.remove(0, n); }
+
+ bool operator==(const ProString &other) const { return toQStringRef() == other.toQStringRef(); }
+ bool operator==(const QString &other) const { return toQStringRef() == other; }
+ bool operator==(QLatin1String other) const { return toQStringRef() == other; }
+ bool operator==(const char *other) const { return toQStringRef() == QLatin1String(other); }
+ bool operator!=(const ProString &other) const { return !(*this == other); }
+ bool operator!=(const QString &other) const { return !(*this == other); }
+ bool operator!=(QLatin1String other) const { return !(*this == other); }
+ bool operator!=(const char *other) const { return !(*this == other); }
+ bool isNull() const { return m_string.isNull(); }
+ bool isEmpty() const { return m_string.isEmpty(); }
+ int length() const { return m_string.size(); }
+ int size() const { return m_string.size(); }
+ QChar at(int i) const { return m_string.at(i); }
+ const QChar *constData() const { return m_string.constData(); }
+ ProString mid(int off, int len = -1) const { return m_string.mid(off, len); }
+ ProString left(int len) const { return mid(0, len); }
+ ProString right(int len) const { return mid(qMax(0, size() - len)); }
+ ProString trimmed() const { return m_string.trimmed(); }
+ int compare(const ProString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().compare(sub.toQStringRef(), cs); }
+ int compare(const QString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().compare(sub, cs); }
+ int compare(const char *sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().compare(QLatin1String(sub), cs); }
+ bool startsWith(const ProString &sub) const { return toQStringRef().startsWith(sub.toQStringRef()); }
+ bool startsWith(const QString &sub) const { return toQStringRef().startsWith(sub); }
+ bool startsWith(const char *sub) const { return toQStringRef().startsWith(QLatin1String(sub)); }
+ bool startsWith(QChar c) const { return toQStringRef().startsWith(c); }
+ bool endsWith(const ProString &sub) const { return toQStringRef().endsWith(sub.toQStringRef()); }
+ bool endsWith(const QString &sub) const { return toQStringRef().endsWith(sub); }
+ bool endsWith(const char *sub) const { return toQStringRef().endsWith(QLatin1String(sub)); }
+ bool endsWith(QChar c) const { return toQStringRef().endsWith(c); }
+ int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().indexOf(s, from, cs); }
+ int indexOf(const char *s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().indexOf(QLatin1String(s), from, cs); }
+ int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().indexOf(c, from, cs); }
+ int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().lastIndexOf(s, from, cs); }
+ int lastIndexOf(const char *s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().lastIndexOf(QLatin1String(s), from, cs); }
+ int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().lastIndexOf(c, from, cs); }
+ bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; }
+ bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; }
+ bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; }
+ int toInt(bool *ok = 0) const { return toQString().toInt(ok); } // XXX optimize
+ short toShort(bool *ok = 0) const { return toQString().toShort(ok); } // XXX optimize
+
+ ALWAYS_INLINE QStringRef toQStringRef() const { return QStringRef(&m_string, 0, m_string.length()); }
+
+ ALWAYS_INLINE ProKey &toKey() { return *(ProKey *)this; }
+ ALWAYS_INLINE const ProKey &toKey() const { return *(const ProKey *)this; }
+
+ QString toQString() const { return m_string; }
+
+ QByteArray toLatin1() const { return toQStringRef().toLatin1(); }
+
+private:
+ ProString(const ProKey &other);
+ ProString &operator=(const ProKey &other);
+
+ QString m_string;
+ friend uint qHash(const ProKey &str, uint seed);
+ friend QString operator+(const ProString &one, const ProString &two);
+ friend QString &operator+=(QString &that, const ProString &other);
+ friend class ProKey;
+};
+Q_DECLARE_TYPEINFO(ProString, Q_MOVABLE_TYPE);
+
+class ProKey : public ProString {
+public:
+ ALWAYS_INLINE ProKey() : ProString() {}
+ explicit ProKey(const QString &str) : ProString(str) {}
+ PROITEM_EXPLICIT ProKey(const char *str) : ProString(str) {}
+
+#ifdef Q_CC_MSVC
+ // Workaround strange MSVC behaviour when exporting classes with ProKey members.
+ ALWAYS_INLINE ProKey(const ProKey &other) : ProString(other.toString()) {}
+ ALWAYS_INLINE ProKey &operator=(const ProKey &other)
+ {
+ toString() = other.toString();
+ return *this;
+ }
+#endif
+
+ ALWAYS_INLINE ProString &toString() { return *(ProString *)this; }
+ ALWAYS_INLINE const ProString &toString() const { return *(const ProString *)this; }
+
+private:
+ ProKey(const ProString &other);
+};
+Q_DECLARE_TYPEINFO(ProKey, Q_MOVABLE_TYPE);
+
+inline uint qHash(const ProKey &key, uint seed = 0)
+ { return qHash(key.m_string, seed); }
+inline QString operator+(const ProString &one, const ProString &two)
+ { return one.m_string + two.m_string; }
+inline QString operator+(const ProString &one, const QString &two)
+ { return one + ProString(two); }
+inline QString operator+(const QString &one, const ProString &two)
+ { return ProString(one) + two; }
+
+inline QString operator+(const ProString &one, const char *two)
+ { return one + ProString(two); } // XXX optimize
+inline QString operator+(const char *one, const ProString &two)
+ { return ProString(one) + two; } // XXX optimize
+
+inline QString &operator+=(QString &that, const ProString &other)
+ { return that += other.toQStringRef(); }
+
+inline bool operator==(const QString &that, const ProString &other)
+ { return other == that; }
+inline bool operator!=(const QString &that, const ProString &other)
+ { return !(other == that); }
+
+inline QTextStream &operator<<(QTextStream &t, const ProString &str)
+ { t << str.toQString(); return t; }
+
+class ProStringList : public QList<ProString> {
+public:
+ ProStringList() {}
+ ProStringList(const ProString &str) { *this << str; }
+ explicit ProStringList(const QStringList &list) : QList<ProString>(*(const ProStringList *)&list) {}
+ QStringList toQStringList() const { return *(const QStringList *)this; }
+
+ ProStringList &operator<<(const ProString &str)
+ { QList<ProString>::operator<<(str); return *this; }
+
+ QString join(const QString &sep) const { return toQStringList().join(sep); }
+
+ void remove(int idx) { removeAt(idx); }
+
+ bool contains(const ProString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ { return contains(str.toQString(), cs); }
+ bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ { return (*(const QStringList *)this).contains(str, cs); }
+ bool contains(const char *str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ { return (*(const QStringList *)this).contains(str, cs); }
+};
+Q_DECLARE_TYPEINFO(ProStringList, Q_MOVABLE_TYPE);
+
+inline ProStringList operator+(const ProStringList &one, const ProStringList &two)
+ { ProStringList ret = one; ret += two; return ret; }
+
+typedef QHash<ProKey, ProStringList> ProValueMap;
+
+QT_END_NAMESPACE
+
+#endif // PROITEMS_H
diff --git a/qmake/library/qmake_global.h b/qmake/library/qmake_global.h
new file mode 100644
index 0000000000..e3c67af72e
--- /dev/null
+++ b/qmake/library/qmake_global.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the qmake application of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMAKE_GLOBAL_H
+#define QMAKE_GLOBAL_H
+
+#include <qglobal.h>
+
+#if defined(QMAKE_AS_LIBRARY)
+# if defined(QMAKE_LIBRARY)
+# define QMAKE_EXPORT Q_DECL_EXPORT
+# else
+# define QMAKE_EXPORT Q_DECL_IMPORT
+# endif
+#else
+# define QMAKE_EXPORT
+#endif
+
+// Be fast even for debug builds
+// MinGW GCC 4.5+ has a problem with always_inline putTok and putBlockLen
+#if defined(__GNUC__) && !(defined(__MINGW32__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define ALWAYS_INLINE inline __attribute__((always_inline))
+#elif defined(_MSC_VER)
+# define ALWAYS_INLINE __forceinline
+#else
+# define ALWAYS_INLINE inline
+#endif
+
+#endif
diff --git a/qmake/meta.cpp b/qmake/meta.cpp
index 717da74704..93e7ed14a5 100644
--- a/qmake/meta.cpp
+++ b/qmake/meta.cpp
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-QHash<QString, QHash<QString, QStringList> > QMakeMetaInfo::cache_vars;
+QHash<QString, ProValueMap> QMakeMetaInfo::cache_vars;
QMakeMetaInfo::QMakeMetaInfo(QMakeProject *_conf)
: conf(_conf)
@@ -143,25 +143,25 @@ QMakeMetaInfo::readLibtoolFile(const QString &f)
dirf = "";
else if(!dirf.isEmpty() && !dirf.endsWith(Option::output_dir))
dirf += QLatin1Char('/');
- const QHash<QString, QStringList> &v = proj.variables();
- for (QHash<QString, QStringList>::ConstIterator it = v.begin(); it != v.end(); ++it) {
- QStringList lst = it.value();
+ const ProValueMap &v = proj.variables();
+ for (ProValueMap::ConstIterator it = v.begin(); it != v.end(); ++it) {
+ ProStringList lst = it.value();
if(lst.count() == 1 && (lst.first().startsWith("'") || lst.first().startsWith("\"")) &&
- lst.first().endsWith(QString(lst.first()[0])))
- lst = QStringList(lst.first().mid(1, lst.first().length() - 2));
+ lst.first().endsWith(QString(lst.first().at(0))))
+ lst = ProStringList(lst.first().mid(1, lst.first().length() - 2));
if(!vars.contains("QMAKE_PRL_TARGET") &&
(it.key() == "dlname" || it.key() == "library_names" || it.key() == "old_library")) {
- QString dir = v["libdir"].first();
- if((dir.startsWith("'") || dir.startsWith("\"")) && dir.endsWith(QString(dir[0])))
+ ProString dir = v["libdir"].first();
+ if ((dir.startsWith('\'') || dir.startsWith('"')) && dir.endsWith(dir.at(0)))
dir = dir.mid(1, dir.length() - 2);
dir = dir.trimmed();
if(!dir.isEmpty() && !dir.endsWith(QLatin1Char('/')))
dir += QLatin1Char('/');
if(lst.count() == 1)
- lst = lst.first().split(" ");
- for(QStringList::Iterator lst_it = lst.begin(); lst_it != lst.end(); ++lst_it) {
+ lst = ProStringList(lst.first().toQString().split(" "));
+ for (ProStringList::Iterator lst_it = lst.begin(); lst_it != lst.end(); ++lst_it) {
bool found = false;
- QString dirs[] = { "", dir, dirf, dirf + ".libs/", "(term)" };
+ QString dirs[] = { "", dir.toQString(), dirf, dirf + ".libs/", "(term)" };
for(int i = 0; !found && dirs[i] != "(term)"; i++) {
if(QFile::exists(dirs[i] + (*lst_it))) {
QString targ = dirs[i] + (*lst_it);
@@ -176,12 +176,12 @@ QMakeMetaInfo::readLibtoolFile(const QString &f)
}
} else if(it.key() == "dependency_libs") {
if(lst.count() == 1) {
- QString dep = lst.first();
+ ProString dep = lst.first();
if ((dep.startsWith('\'') || dep.startsWith('"')) && dep.endsWith(dep.at(0)))
dep = dep.mid(1, dep.length() - 2);
- lst = dep.trimmed().split(" ");
+ lst = ProStringList(dep.trimmed().toQString().split(" "));
}
- for(QStringList::Iterator lit = lst.begin(); lit != lst.end(); ++lit) {
+ for (ProStringList::Iterator lit = lst.begin(); lit != lst.end(); ++lit) {
if((*lit).startsWith("-R")) {
if(!conf->isEmpty("QMAKE_LFLAGS_RPATH"))
(*lit) = conf->first("QMAKE_LFLAGS_RPATH") + (*lit).mid(2);
diff --git a/qmake/meta.h b/qmake/meta.h
index bfdb1088dc..174933e600 100644
--- a/qmake/meta.h
+++ b/qmake/meta.h
@@ -42,6 +42,8 @@
#ifndef META_H
#define META_H
+#include "project.h"
+
#include <qhash.h>
#include <qstringlist.h>
#include <qstring.h>
@@ -55,9 +57,9 @@ class QMakeMetaInfo
bool readLibtoolFile(const QString &f);
bool readPkgCfgFile(const QString &f);
QMakeProject *conf;
- QHash<QString, QStringList> vars;
+ ProValueMap vars;
QString meta_type;
- static QHash<QString, QHash<QString, QStringList> > cache_vars;
+ static QHash<QString, ProValueMap> cache_vars;
void clear();
public:
QMakeMetaInfo(QMakeProject *_conf);
@@ -67,35 +69,35 @@ public:
static bool libExists(QString lib);
QString type() const;
- bool isEmpty(const QString &v);
- QStringList &values(const QString &v);
- QString first(const QString &v);
- QHash<QString, QStringList> &variables();
+ bool isEmpty(const ProKey &v);
+ ProStringList &values(const ProKey &v);
+ ProString first(const ProKey &v);
+ ProValueMap &variables();
};
-inline bool QMakeMetaInfo::isEmpty(const QString &v)
+inline bool QMakeMetaInfo::isEmpty(const ProKey &v)
{ return !vars.contains(v) || vars[v].isEmpty(); }
inline QString QMakeMetaInfo::type() const
{ return meta_type; }
-inline QStringList &QMakeMetaInfo::values(const QString &v)
+inline ProStringList &QMakeMetaInfo::values(const ProKey &v)
{ return vars[v]; }
-inline QString QMakeMetaInfo::first(const QString &v)
+inline ProString QMakeMetaInfo::first(const ProKey &v)
{
#if defined(Q_CC_SUN) && (__SUNPRO_CC == 0x500) || defined(Q_CC_HP)
// workaround for Sun WorkShop 5.0 bug fixed in Forte 6
if (isEmpty(v))
- return QString("");
+ return ProString("");
else
return vars[v].first();
#else
- return isEmpty(v) ? QString("") : vars[v].first();
+ return isEmpty(v) ? ProString("") : vars[v].first();
#endif
}
-inline QHash<QString, QStringList> &QMakeMetaInfo::variables()
+inline ProValueMap &QMakeMetaInfo::variables()
{ return vars; }
inline bool QMakeMetaInfo::libExists(QString lib)
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 1a663c14c5..570b54de43 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -534,21 +534,21 @@ void Option::prepareProject(const QString &pfile)
bool Option::postProcessProject(QMakeProject *project)
{
- Option::cpp_ext = project->values("QMAKE_EXT_CPP");
- Option::h_ext = project->values("QMAKE_EXT_H");
- Option::c_ext = project->values("QMAKE_EXT_C");
- Option::res_ext = project->first("QMAKE_EXT_RES");
- Option::pkgcfg_ext = project->first("QMAKE_EXT_PKGCONFIG");
- Option::libtool_ext = project->first("QMAKE_EXT_LIBTOOL");
- Option::prl_ext = project->first("QMAKE_EXT_PRL");
- Option::ui_ext = project->first("QMAKE_EXT_UI");
- Option::cpp_moc_ext = project->first("QMAKE_EXT_CPP_MOC");
- Option::lex_ext = project->first("QMAKE_EXT_LEX");
- Option::yacc_ext = project->first("QMAKE_EXT_YACC");
- Option::obj_ext = project->first("QMAKE_EXT_OBJ");
- Option::h_moc_mod = project->first("QMAKE_H_MOD_MOC");
- Option::lex_mod = project->first("QMAKE_MOD_LEX");
- Option::yacc_mod = project->first("QMAKE_MOD_YACC");
+ Option::cpp_ext = project->values("QMAKE_EXT_CPP").toQStringList();
+ Option::h_ext = project->values("QMAKE_EXT_H").toQStringList();
+ Option::c_ext = project->values("QMAKE_EXT_C").toQStringList();
+ Option::res_ext = project->first("QMAKE_EXT_RES").toQString();
+ Option::pkgcfg_ext = project->first("QMAKE_EXT_PKGCONFIG").toQString();
+ Option::libtool_ext = project->first("QMAKE_EXT_LIBTOOL").toQString();
+ Option::prl_ext = project->first("QMAKE_EXT_PRL").toQString();
+ Option::ui_ext = project->first("QMAKE_EXT_UI").toQString();
+ Option::cpp_moc_ext = project->first("QMAKE_EXT_CPP_MOC").toQString();
+ Option::lex_ext = project->first("QMAKE_EXT_LEX").toQString();
+ Option::yacc_ext = project->first("QMAKE_EXT_YACC").toQString();
+ Option::obj_ext = project->first("QMAKE_EXT_OBJ").toQString();
+ Option::h_moc_mod = project->first("QMAKE_H_MOD_MOC").toQString();
+ Option::lex_mod = project->first("QMAKE_MOD_LEX").toQString();
+ Option::yacc_mod = project->first("QMAKE_MOD_YACC").toQString();
if (Option::output_dir.startsWith(project->buildRoot()))
Option::mkfile::cachefile_depth =
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 4f26db8bb0..9fa9ac05a5 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -574,14 +574,14 @@ QStringList QMakeProject::qmakeFeaturePaths()
const QString mkspecs_concat = QLatin1String("/mkspecs");
const QString base_concat = QLatin1String("/features");
QStringList concat;
- foreach (const QString &sfx, values("QMAKE_PLATFORM"))
+ foreach (const QString &sfx, values("QMAKE_PLATFORM", vars))
concat << base_concat + QLatin1Char('/') + sfx;
concat << base_concat;
QStringList feature_roots = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEFEATURES")));
feature_roots += cached_qmakefeatures;
if(prop)
- feature_roots += splitPathList(prop->value("QMAKEFEATURES"));
+ feature_roots += splitPathList(prop->value("QMAKEFEATURES").toQString());
QStringList feature_bases;
if (!cached_build_root.isEmpty())
feature_bases << cached_build_root;
@@ -697,7 +697,7 @@ QMakeProject::cleanup()
QMakeProject::QMakeProject(QMakeProject *p, const QHash<QString, QStringList> *_vars)
{
init(p->properties());
- vars = _vars ? *_vars : p->variables();
+ vars = _vars ? *_vars : p->vars;
host_build = p->host_build;
for(QHash<QString, FunctionBlock*>::iterator it = p->replaceFunctions.begin(); it != p->replaceFunctions.end(); ++it) {
it.value()->ref();
@@ -1487,7 +1487,7 @@ QMakeProject::read(uchar cmd)
#else
// We can't resolve symlinks as they do on Unix, so configure.exe puts the source of the
// qmake.conf at the end of the default/qmake.conf in the QMAKESPEC_ORG variable.
- QString orig_spec = first(QLatin1String("QMAKESPEC_ORIGINAL"));
+ QString orig_spec = first(ProKey("QMAKESPEC_ORIGINAL")).toQString();
real_spec = orig_spec.isEmpty() ? qmakespec : orig_spec;
#endif
vars["QMAKESPEC"] << real_spec;
@@ -1496,7 +1496,7 @@ QMakeProject::read(uchar cmd)
// The spec extends the feature search path, so invalidate the cache.
invalidateFeatureRoots();
// The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it
- Option::dir_sep = first(QLatin1String("QMAKE_DIR_SEP"));
+ Option::dir_sep = first("QMAKE_DIR_SEP").toQString();
if (!conffile.isEmpty()) {
debug_msg(1, "Project config file: reading %s", conffile.toLatin1().constData());
@@ -1521,9 +1521,9 @@ QMakeProject::read(uchar cmd)
doProjectInclude("spec_pre", IncludeFlagFeature, vars);
}
- for (QHash<QString, QStringList>::ConstIterator it = extra_vars.constBegin();
+ for (ProValueMap::ConstIterator it = extra_vars.constBegin();
it != extra_vars.constEnd(); ++it)
- vars.insert(it.key(), it.value());
+ vars.insert(it.key().toQString(), it.value().toQStringList());
if(cmd & ReadFeatures) {
debug_msg(1, "Processing default_pre: %s", vars["CONFIG"].join("::").toLatin1().constData());
@@ -1861,11 +1861,11 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString
// possible to use "place" everywhere. Instead just set variables and grab them later
QMakeProject proj(prop);
if(flags & IncludeFlagNewParser) {
- parsed = proj.read(file, proj.variables()); // parse just that file (fromfile, infile)
+ parsed = proj.read(file, proj.vars); // parse just that file (fromfile, infile)
} else {
parsed = proj.read(file); // parse all aux files (load/include into)
}
- place = proj.variables();
+ place = proj.vars;
} else {
QStack<ScopeBlock> sc = scope_blocks;
IteratorBlock *it = iterator;
@@ -3520,10 +3520,10 @@ QMakeProject::test(const QString &v)
}
bool
-QMakeProject::test(const QString &func, const QList<QStringList> &args)
+QMakeProject::test(const ProKey &func, const QList<ProStringList> &args)
{
QHash<QString, QStringList> tmp = vars;
- return doProjectTest(func, args, tmp);
+ return doProjectTest(func.toQString(), *(const QList<QStringList> *)&args, tmp);
}
QStringList
@@ -3552,10 +3552,10 @@ QMakeProject::expand(const QString &str, const QString &file, int line)
}
QStringList
-QMakeProject::expand(const QString &func, const QList<QStringList> &args)
+QMakeProject::expand(const ProKey &func, const QList<ProStringList> &args)
{
QHash<QString, QStringList> tmp = vars;
- return doProjectExpand(func, args, tmp);
+ return doProjectExpand(func.toString().toQString(), *(const QList<QStringList> *)&args, tmp);
}
bool
@@ -3680,7 +3680,7 @@ QMakeProject::doVariableReplaceExpand(const QString &str, QHash<QString, QString
if (var == "QMAKE_MKSPECS")
replacement = split_value_list(qmake_mkspec_paths().join(Option::dirlist_sep));
else if (prop)
- replacement = split_value_list(prop->value(var));
+ replacement = split_value_list(prop->value(ProKey(var)).toQString());
} else if(var_type == FUNCTION) {
replacement = doProjectExpand(var, args, place);
} else if(var_type == VAR) {
@@ -3776,9 +3776,9 @@ QStringList &QMakeProject::values(const QString &_var, QHash<QString, QStringLis
return place[var];
}
-bool QMakeProject::isEmpty(const QString &v) const
+bool QMakeProject::isEmpty(const ProKey &v) const
{
- QHash<QString, QStringList>::ConstIterator it = vars.constFind(v);
+ QHash<QString, QStringList>::ConstIterator it = vars.constFind(v.toQString());
return it == vars.constEnd() || it->isEmpty();
}
diff --git a/qmake/project.h b/qmake/project.h
index 43ec8ae5dc..3d6de87298 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -42,6 +42,8 @@
#ifndef PROJECT_H
#define PROJECT_H
+#include <proitems.h>
+
#include <qstringlist.h>
#include <qtextstream.h>
#include <qstring.h>
@@ -90,8 +92,9 @@ class QMakeProject
QString pfile;
QMakeProperty *prop;
void reset();
- QStringList extra_configs;
- QHash<QString, QStringList> vars, init_vars, base_vars, extra_vars;
+ ProStringList extra_configs;
+ ProValueMap extra_vars;
+ QHash<QString, QStringList> vars, init_vars, base_vars;
bool parse(const QString &text, QHash<QString, QStringList> &place, int line_count=1);
enum IncludeStatus {
@@ -125,8 +128,8 @@ public:
QMakeProject(QMakeProject *p, const QHash<QString, QStringList> *nvars=0);
~QMakeProject();
- void setExtraVars(const QHash<QString, QStringList> &_vars) { extra_vars = _vars; }
- void setExtraConfigs(const QStringList &_cfgs) { extra_configs = _cfgs; }
+ void setExtraVars(const ProValueMap &_vars) { extra_vars = _vars; }
+ void setExtraConfigs(const ProStringList &_cfgs) { extra_configs = _cfgs; }
enum { ReadProFile=0x01, ReadSetup=0x02, ReadFeatures=0x04, ReadAll=0xFF };
inline bool parse(const QString &text) { return parse(text, vars); }
@@ -159,20 +162,20 @@ public:
QStringList expand(const QString &v);
QString expand(const QString &v, const QString &file, int line);
- QStringList expand(const QString &func, const QList<QStringList> &args);
+ QStringList expand(const ProKey &func, const QList<ProStringList> &args);
bool test(const QString &v);
- bool test(const QString &func, const QList<QStringList> &args);
+ bool test(const ProKey &func, const QList<ProStringList> &args);
bool isActiveConfig(const QString &x, bool regex=false,
QHash<QString, QStringList> *place=NULL);
- bool isSet(const QString &v) const { return vars.contains(v); }
- bool isEmpty(const QString &v) const;
- QStringList values(const QString &v) const { return vars[v]; }
- QStringList &values(const QString &v) { return vars[v]; }
- QString first(const QString &v) const;
- int intValue(const QString &v, int defaultValue = 0) const;
- const QHash<QString, QStringList> &variables() const { return vars; }
- QHash<QString, QStringList> &variables() { return vars; }
+ bool isSet(const ProKey &v) const { return (*(const ProValueMap *)&vars).contains(v); }
+ bool isEmpty(const ProKey &v) const;
+ ProStringList values(const ProKey &v) const { return (*(const ProValueMap *)&vars)[v]; }
+ ProStringList &values(const ProKey &v) { return (*(ProValueMap *)&vars)[v]; }
+ ProString first(const ProKey &v) const;
+ int intValue(const ProKey &v, int defaultValue = 0) const;
+ const ProValueMap &variables() const { return *(const ProValueMap *)&vars; }
+ ProValueMap &variables() { return *(ProValueMap *)&vars; }
void dump() const;
@@ -191,17 +194,17 @@ inline QString QMakeProject::projectFile()
return pfile;
}
-inline QString QMakeProject::first(const QString &v) const
+inline ProString QMakeProject::first(const ProKey &v) const
{
- const QStringList vals = values(v);
+ const ProStringList &vals = values(v);
if(vals.isEmpty())
- return QString("");
+ return ProString("");
return vals.first();
}
-inline int QMakeProject::intValue(const QString &v, int defaultValue) const
+inline int QMakeProject::intValue(const ProKey &v, int defaultValue) const
{
- const QString str = first(v);
+ const ProString &str = first(v);
if (!str.isEmpty()) {
bool ok;
int i = str.toInt(&ok);
diff --git a/qmake/property.cpp b/qmake/property.cpp
index 258a2cf1d0..5b34d2d3e6 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -77,17 +77,17 @@ QMakeProperty::QMakeProperty() : settings(0)
{
for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) {
QString name = QString::fromLatin1(propList[i].name);
- m_values[name + "/get"] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
+ m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths);
if (!propList[i].raw) {
- m_values[name] = QLibraryInfo::location(propList[i].loc);
+ m_values[ProKey(name)] = QLibraryInfo::location(propList[i].loc);
name += "/raw";
}
- m_values[name] = val;
+ m_values[ProKey(name)] = val;
}
- m_values["QMAKE_VERSION"] = qmake_version();
+ m_values["QMAKE_VERSION"] = ProString(qmake_version());
#ifdef QT_VERSION_STR
- m_values["QT_VERSION"] = QT_VERSION_STR;
+ m_values["QT_VERSION"] = ProString(QT_VERSION_STR);
#endif
}
@@ -105,21 +105,22 @@ void QMakeProperty::initSettings()
}
}
-QString
-QMakeProperty::value(const QString &v)
+ProString
+QMakeProperty::value(const ProKey &vk)
{
- QString val = m_values.value(v);
+ ProString val = m_values.value(vk);
if (!val.isNull())
return val;
initSettings();
+ QString v = vk.toQString();
if (!settings->contains(v))
return settings->value("2.01a/" + v).toString(); // Backwards compat
return settings->value(v).toString();
}
bool
-QMakeProperty::hasValue(QString v)
+QMakeProperty::hasValue(const ProKey &v)
{
return !value(v).isNull();
}
@@ -164,9 +165,9 @@ QMakeProperty::exec()
specialProps.append("QT_VERSION");
#endif
foreach (QString prop, specialProps) {
- QString val = value(prop);
- QString pval = value(prop + "/raw");
- QString gval = value(prop + "/get");
+ ProString val = value(ProKey(prop));
+ ProString pval = value(ProKey(prop + "/raw"));
+ ProString gval = value(ProKey(prop + "/get"));
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());
@@ -179,11 +180,12 @@ QMakeProperty::exec()
it != Option::prop::properties.end(); it++) {
if(Option::prop::properties.count() > 1)
fprintf(stdout, "%s:", (*it).toLatin1().constData());
- if(!hasValue((*it))) {
+ const ProKey pkey(*it);
+ if (!hasValue(pkey)) {
ret = false;
fprintf(stdout, "**Unknown**\n");
} else {
- fprintf(stdout, "%s\n", value((*it)).toLatin1().constData());
+ fprintf(stdout, "%s\n", value(pkey).toLatin1().constData());
}
}
} else if(Option::qmake_mode == Option::QMAKE_SET_PROPERTY) {
diff --git a/qmake/property.h b/qmake/property.h
index 13767ff405..4748dd7f31 100644
--- a/qmake/property.h
+++ b/qmake/property.h
@@ -42,6 +42,8 @@
#ifndef PROPERTY_H
#define PROPERTY_H
+#include "library/proitems.h"
+
#include <qglobal.h>
#include <qstring.h>
#include <qhash.h>
@@ -55,14 +57,15 @@ class QMakeProperty
QSettings *settings;
void initSettings();
- QHash<QString, QString> m_values;
+ QHash<ProKey, ProString> m_values;
public:
QMakeProperty();
~QMakeProperty();
- bool hasValue(QString);
- QString value(const QString &);
+ bool hasValue(const ProKey &);
+ ProString value(const ProKey &);
+
void setValue(QString, const QString &);
void remove(const QString &);
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index a9f17c4a23..985e4de3d7 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -17,7 +17,9 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
generators/integrity/gbuild.cpp \
generators/win32/cesdkhandler.cpp
-HEADERS += project.h property.h generators/makefile.h \
+HEADERS += project.h property.h \
+ library/qmake_global.h library/proitems.h \
+ generators/makefile.h \
generators/unix/unixmake.h meta.h option.h cachekeys.h \
generators/win32/winmakefile.h generators/win32/mingw_make.h generators/projectgenerator.h \
generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 2b897f1e80..4b03d66fc1 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -23,6 +23,7 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \
$$QT_SOURCE_TREE/tools/shared/windows
INCLUDEPATH += . \
+ library \
generators \
generators/unix \
generators/win32 \