introduce qmake variable abstractions
this is preparation for adapting to a new evaluator. Change-Id: I6fc59f5525735754a00afa6629fbfe257e84db97 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
parent
9c29beb9ea
commit
df175f190d
@ -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 \
|
||||
|
@ -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) \
|
||||
|
@ -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++ \
|
||||
|
@ -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 ";
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
protected:
|
||||
bool doPrecompiledHeaders() const { return false; }
|
||||
virtual bool doDepends() const { return true; }
|
||||
QStringList nativebins;
|
||||
ProStringList nativebins;
|
||||
|
||||
};
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 &);
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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\"";
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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..
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
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);
|
||||
|
||||
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));
|
||||
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())
|
||||
|
@ -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);
|
||||
|
||||
|
225
qmake/library/proitems.h
Normal file
225
qmake/library/proitems.h
Normal file
@ -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
|
67
qmake/library/qmake_global.h
Normal file
67
qmake/library/qmake_global.h
Normal file
@ -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
|
@ -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);
|
||||
|
26
qmake/meta.h
26
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)
|
||||
|
@ -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 =
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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 &);
|
||||
|
||||
|
@ -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 \
|
||||
|
@ -23,6 +23,7 @@ VPATH += $$QT_SOURCE_TREE/src/corelib/global \
|
||||
$$QT_SOURCE_TREE/tools/shared/windows
|
||||
|
||||
INCLUDEPATH += . \
|
||||
library \
|
||||
generators \
|
||||
generators/unix \
|
||||
generators/win32 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user