From 721d7a47ba22fd791f2569427dd6285ac3384ff5 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 26 Feb 2010 13:07:02 +0100 Subject: Removed restrictions on file names from the Symbian makefile system. Spaces in filenames still won't work, but that is very tricky to fix because you cannot escape filenames inside the QMAKE_EXTRA_COMPILERS section. Task: QTBUG-8555 --- mkspecs/features/symbian/application_icon.prf | 8 +++++--- .../symbian/linux-armcc/features/symbian_building.prf | 4 +--- qmake/generators/symbian/symbiancommon.cpp | 19 ++++++++++++++----- qmake/generators/symbian/symbiancommon.h | 1 + qmake/generators/symbian/symmake.cpp | 4 ++-- qmake/generators/symbian/symmake_abld.cpp | 4 ++-- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 41f1718..527c33d 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -22,10 +22,12 @@ contains( CONFIG, no_icon ) { baseTarget = $$basename(TARGET) baseTarget = $$replace(baseTarget, /,_) baseTarget = $$replace(baseTarget, \\,_) - baseTarget = $$replace(baseTarget, -,_) - baseTarget = $$replace(baseTarget, :,_) - baseTarget = $$replace(baseTarget, \.,_) baseTarget = $$replace(baseTarget, " ",_) + symbian-abld|symbian-sbsv2 { + baseTarget = $$replace(baseTarget, -,_) + baseTarget = $$replace(baseTarget, \.,_) + baseTarget = $$replace(baseTarget, :,_) + } # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code !symbian-sbsv2 { diff --git a/mkspecs/symbian/linux-armcc/features/symbian_building.prf b/mkspecs/symbian/linux-armcc/features/symbian_building.prf index b0185d0..67b3075 100644 --- a/mkspecs/symbian/linux-armcc/features/symbian_building.prf +++ b/mkspecs/symbian/linux-armcc/features/symbian_building.prf @@ -150,9 +150,7 @@ QMAKE_EXTRA_COMPILERS += symbianresources contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { baseTarget = $$basename(TARGET) - baseTarget = $$replace(baseTarget, -,_) - baseTarget = $$replace(baseTarget, :,_) - baseTarget = $$replace(baseTarget, \.,_) + # If you change this, also see application_icon.prf baseTarget = $$replace(baseTarget, " ",_) # Make our own extra compiler target in order to get dependencies for generated diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 9992faa..c7f8cd4 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -68,9 +68,13 @@ void SymbianCommonGenerator::init() fixedTarget = project->first("QMAKE_ORIG_TARGET"); if (fixedTarget.isEmpty()) fixedTarget = project->first("TARGET"); - fixedTarget = generator->escapeFilePath(fixedTarget); + fixedTarget = generator->unescapeFilePath(fixedTarget); fixedTarget = removePathSeparators(fixedTarget); - removeSpecialCharacters(fixedTarget); + if (project->first("MAKEFILE_GENERATOR") == "SYMBIAN_ABLD" + || project->first("MAKEFILE_GENERATOR") == "SYMBIAN_SBSV2") + removeEpocSpecialCharacters(fixedTarget); + else + removeSpecialCharacters(fixedTarget); // This should not be empty since the mkspecs are supposed to set it if missing. uid3 = project->first("TARGET.UID3").trimmed(); @@ -120,10 +124,16 @@ void SymbianCommonGenerator::removeSpecialCharacters(QString& str) // When modifying this method check also application_icon.prf str.replace(QString("/"), QString("_")); str.replace(QString("\\"), QString("_")); + str.replace(QString(" "), QString("_")); +} + +void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str) +{ + // When modifying this method check also application_icon.prf str.replace(QString("-"), QString("_")); str.replace(QString(":"), QString("_")); str.replace(QString("."), QString("_")); - str.replace(QString(" "), QString("_")); + removeSpecialCharacters(str); } void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList, bool epocBuild) @@ -132,7 +142,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, Deployment QString pkgTarget = project->first("QMAKE_ORIG_TARGET"); if (pkgTarget.isEmpty()) pkgTarget = project->first("TARGET"); - pkgTarget = generator->escapeFilePath(pkgTarget); + pkgTarget = generator->unescapeFilePath(pkgTarget); pkgTarget = removePathSeparators(pkgTarget); QString pkgFilename = QString("%1_template.%2").arg(pkgTarget).arg("pkg"); if (!Option::output_dir.isEmpty()) @@ -309,7 +319,6 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, Deployment QDir mifIconDir(project->first("DESTDIR")); QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET"))); QString mifIconFileName = mifIcon.fileName(); - mifIconFileName.replace(QRegExp("[-: .]"), "_"); mifIconFileName.append(".mif"); t << QString("\"%1/%2\" - \"!:%3\"") .arg(mifIcon.path()) diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h index 32f9483..9aaa9a1 100644 --- a/qmake/generators/symbian/symbiancommon.h +++ b/qmake/generators/symbian/symbiancommon.h @@ -67,6 +67,7 @@ protected: QString removePathSeparators(QString &file); void removeSpecialCharacters(QString& str); + void removeEpocSpecialCharacters(QString& str); void generatePkgFile(const QString &iconFile, DeploymentList &depList, bool epocBuild); bool containsStartWithItem(const QChar &c, const QStringList& src); diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 5283bfa..5b230e4 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -173,7 +173,7 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) bldinfDefine.append(generate_uid(project->projectFile())); bldinfDefine.prepend("BLD_INF_"); - removeSpecialCharacters(bldinfDefine); + removeEpocSpecialCharacters(bldinfDefine); t << "#define " << bldinfDefine.toUpper() << endl << endl; } @@ -1032,7 +1032,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy QString uid = generate_uid(fullProName); QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid; bldinfDefine = bldinfDefine.toUpper(); - removeSpecialCharacters(bldinfDefine); + removeEpocSpecialCharacters(bldinfDefine); t << "#ifndef " << bldinfDefine << endl; t << "\t#include \"" << bldinfFilename << "\"" << endl; diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index b620258..aec16fd 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -69,7 +69,7 @@ SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { } void SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) { QString gnuMakefileName = QLatin1String("Makefile_") + uid3; - removeSpecialCharacters(gnuMakefileName); + removeEpocSpecialCharacters(gnuMakefileName); gnuMakefileName.append(".mk"); QFile ft(gnuMakefileName); @@ -451,7 +451,7 @@ void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool ad // do not get that, special deployment only makefile is generated for them if needed. if (targetType != TypeSubdirs || addDeploymentExtension) { QString gnuMakefileName = QLatin1String("Makefile_") + uid3; - removeSpecialCharacters(gnuMakefileName); + removeEpocSpecialCharacters(gnuMakefileName); gnuMakefileName.append(".mk"); t << "gnumakefile " << gnuMakefileName << endl; } -- cgit v0.12