summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp9
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp85
-rw-r--r--qmake/generators/symbian/symmake.cpp16
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp2
5 files changed, 84 insertions, 30 deletions
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index 6407412..4552185 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -91,12 +91,13 @@ static void createPluginStub(const QFileInfo& info,
QStringList& generatedDirs,
QStringList& generatedFiles)
{
- QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR));
- if (!generatedDirs.contains(PLUGIN_STUB_DIR))
- generatedDirs << PLUGIN_STUB_DIR;
+ QString pluginStubDir = Option::output_dir + QLatin1Char('/') + QLatin1String(PLUGIN_STUB_DIR);
+ QDir().mkpath(pluginStubDir);
+ if (!generatedDirs.contains(pluginStubDir))
+ generatedDirs << pluginStubDir;
// Plugin stubs must have different name from the actual plugins, because
// the toolchain for creating ROM images cannot handle non-binary .dll files properly.
- QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "/") + info.completeBaseName() + "." SUFFIX_QTPLUGIN);
+ QFile stubFile(pluginStubDir + QLatin1Char('/') + info.completeBaseName() + QLatin1Char('.') + QLatin1String(SUFFIX_QTPLUGIN));
if (stubFile.open(QIODevice::WriteOnly)) {
if (!generatedFiles.contains(stubFile.fileName()))
generatedFiles << stubFile.fileName();
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index b730d9e..aa44afc 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -142,6 +142,13 @@ void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str)
removeSpecialCharacters(str);
}
+QString romPath(const QString& path)
+{
+ if(path.length() > 2 && path[1] == ':')
+ return QLatin1String("z:") + path.mid(2);
+ return QLatin1String("z:") + path;
+}
+
void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocBuild)
{
QMakeProject *project = generator->project;
@@ -150,9 +157,8 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
pkgTarget = project->first("TARGET");
pkgTarget = generator->unescapeFilePath(pkgTarget);
pkgTarget = removePathSeparators(pkgTarget);
- QString pkgFilename = QString("%1_template.%2").arg(pkgTarget).arg("pkg");
- if (!Option::output_dir.isEmpty())
- pkgFilename = Option::output_dir + '/' + pkgFilename;
+ QString pkgFilename = Option::output_dir + QLatin1Char('/') +
+ QString("%1_template.pkg").arg(pkgTarget);
QFile pkgFile(pkgFilename);
if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -160,8 +166,19 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
return;
}
+ QString stubPkgFileName = Option::output_dir + QLatin1Char('/') +
+ QString("%1_stub.pkg").arg(pkgTarget);
+
+ QFile stubPkgFile(stubPkgFileName);
+ if (!stubPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ PRINT_FILE_CREATE_ERROR(stubPkgFileName);
+ return;
+ }
+
generatedFiles << pkgFile.fileName();
QTextStream t(&pkgFile);
+ generatedFiles << stubPkgFile.fileName();
+ QTextStream ts(&stubPkgFile);
QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n");
if (installerSisHeader.isEmpty())
@@ -173,14 +190,15 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate);
// Header info
- QString wrapperPkgFilename = QString("%1_installer.%2")
- .arg(pkgTarget)
- .arg("pkg");
+ QString wrapperPkgFilename = Option::output_dir + QLatin1Char('/') + QString("%1_installer.%2")
+ .arg(pkgTarget).arg("pkg");
+
QString headerComment = "; %1 generated by qmake at %2\n"
"; This file is generated by qmake and should not be modified by the user\n"
";\n\n";
t << headerComment.arg(pkgFilename).arg(dateStr);
tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);
+ ts << headerComment.arg(stubPkgFileName).arg(dateStr);
// Construct QStringList from pkg_prerules since we need search it before printed to file
// Note: Though there can't be more than one language or header line, use stringlists
@@ -230,6 +248,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
t << languageRules.join("\n") << endl;
tw << languageRules.join("\n") << endl;
+ ts << languageRules.join("\n") << endl;
// name of application, UID and version
QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
@@ -245,10 +264,14 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
tw << installerSisHeader << endl;
}
- if (headerRules.isEmpty())
+ if (headerRules.isEmpty()) {
t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
- else
+ ts << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
+ }
+ else {
t << headerRules.join("\n") << endl;
+ ts << headerRules.join("\n") << endl;
+ }
// Localized vendor name
QString vendorName;
@@ -263,22 +286,33 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
t << vendorName;
tw << vendorName;
+ ts << vendorName;
// PKG pre-rules - these are added before actual file installations i.e. SIS package body
if (rawPkgPreRules.size()) {
QString comment = "\n; Manual PKG pre-rules from PRO files\n";
t << comment;
tw << comment;
+ ts << comment;
foreach(QString item, rawPkgPreRules) {
- // Only regular pkg file should have package dependencies or pkg header if that is
- // defined using prerules.
- if (!item.startsWith("(") && !item.startsWith("#")) {
+ // Only regular pkg file should have package dependencies
+ if (item.startsWith("(")) {
+ t << item << endl;
+ }
+ // stub pkg file should not have platform dependencies
+ else if (item.startsWith("[")) {
+ t << item << endl;
+ tw << item << endl;
+ }
+ else {
+ t << item << endl;
+ ts << item << endl;
tw << item << endl;
}
- t << item << endl;
}
t << endl;
+ ts << endl;
tw << endl;
}
@@ -320,41 +354,54 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// deploy .exe file
t << "; Executable and default resource files" << endl;
QString exeFile = fixedTarget + ".exe";
- t << QString("\"%1/%2\" - \"%3\\%4\"")
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
.arg(destDirBin)
.arg(exeFile)
.arg(installPathBin)
.arg(exeFile) << endl;
+ ts << QString("\"\" - \"%1\\%2\"")
+ .arg(romPath(installPathBin))
+ .arg(exeFile) << endl;
// deploy rsc & reg_rsc file
if (!project->isActiveConfig("no_icon")) {
- t << QString("\"%1/%2\" - \"%3\\%4\"")
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
.arg(destDirResource)
.arg(fixedTarget + ".rsc")
.arg(installPathResource)
.arg(fixedTarget + ".rsc") << endl;
+ ts << QString("\"\" - \"%1\\%2\"")
+ .arg(romPath(installPathResource))
+ .arg(fixedTarget + ".rsc") << endl;
- t << QString("\"%1/%2\" - \"%3\\%4\"")
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
.arg(destDirRegResource)
.arg(fixedTarget + "_reg.rsc")
.arg(installPathRegResource)
.arg(fixedTarget + "_reg.rsc") << endl;
+ ts << QString("\"\" - \"%1\\%2\"")
+ .arg(romPath(installPathRegResource))
+ .arg(fixedTarget + "_reg.rsc") << endl;
if (!iconFile.isEmpty()) {
if (epocBuild) {
- t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
+ t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
.arg(epocRoot())
.arg(iconFile)
.arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
+ ts << QString("\"\" - \"%1\"")
+ .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl;
} else {
QDir mifIconDir(project->first("DESTDIR"));
QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET")));
QString mifIconFileName = mifIcon.fileName();
mifIconFileName.append(".mif");
- t << QString("\"%1/%2\" - \"!:%3\"")
+ t << QString("\"%1/%2\" - \"!:%3\"")
.arg(mifIcon.path())
.arg(mifIconFileName)
.arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
+ ts << QString("\"\" - \"%1\"")
+ .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl;
}
}
}
@@ -390,9 +437,11 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
}
}
- t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;
+ t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;
+ ts << QString("\"\" - \"%1\"").arg(romPath(to)) << endl;
}
t << endl;
+ ts << endl;
// PKG post-rules - these are added after actual file installations i.e. SIS package body
t << "; Manual PKG post-rules from PRO files" << endl;
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index faafb20..1006e39 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -175,6 +175,12 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t)
bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
{
+ if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
+ fprintf(stderr, "Project files not generated because all requirements are not met:\n\t%s\n",
+ qPrintable(var("QMAKE_FAILED_REQUIREMENTS")));
+ return false;
+ }
+
writeHeader(t);
QString numberOfIcons;
@@ -208,7 +214,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
// Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile,
// but all required data is not yet available.
bool isPrimaryMakefile = true;
- QString wrapperFileName("Makefile");
+ QString wrapperFileName = Option::output_dir + QLatin1Char('/') + QLatin1String("Makefile");
QString outputFileName = fileInfo(Option::output.fileName()).fileName();
if (outputFileName != BLD_INF_FILENAME) {
wrapperFileName.append(".").append(outputFileName.startsWith(BLD_INF_FILENAME)
@@ -240,10 +246,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t)
shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString(""));
shortProFilename.replace(Option::pro_ext, QString(""));
- QString mmpFilename = shortProFilename;
- mmpFilename.append("_");
- mmpFilename.append(uid3);
- mmpFilename.append(Option::mmp_ext);
+ QString mmpFilename = Option::output_dir + QLatin1Char('/') + shortProFilename + QLatin1Char('_')
+ + uid3 + Option::mmp_ext;
writeMmpFile(mmpFilename, symbianLangCodes);
if (targetType == TypeExe) {
@@ -264,7 +268,7 @@ void SymbianMakefileGenerator::writeCustomDefFile()
{
if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
// Create custom def file for plugin
- QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
+ QFile ft(Option::output_dir + QLatin1Char('/') + QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
if (ft.open(QIODevice::WriteOnly)) {
generatedFiles << ft.fileName();
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 0ba1a3c..7e3fb45 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -199,7 +199,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << "# ==============================================================================" << "\n" << endl;
t << endl;
- t << "MAKEFILE = " << wrapperFile.fileName() << endl;
+ t << "MAKEFILE = " << fileInfo(wrapperFile.fileName()).fileName() << endl;
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 3a6706a..feacbef 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -143,7 +143,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
t << "#" << endl;
t << "# ==============================================================================" << "\n" << endl;
t << endl;
- t << "MAKEFILE = " << wrapperFile.fileName() << endl;
+ t << "MAKEFILE = " << fileInfo(wrapperFile.fileName()).fileName() << endl;
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;