diff options
Diffstat (limited to 'qmake/generators/mac/pbuilder_pbx.cpp')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 193 |
1 files changed, 70 insertions, 123 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 8f24c20712..36ec6ef742 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -151,7 +151,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) subdir += Option::dir_sep; tmp = subdir + tmp; } - QFileInfo fi(fileInfo(Option::fixPathToLocalOS(tmp, true))); + QFileInfo fi(fileInfo(Option::normalizePath(tmp))); if(fi.exists()) { if(fi.isDir()) { QString profile = tmp; @@ -215,7 +215,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) t << "\t\t" << project_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("lastKnownFileType", "wrapper.pb-project") << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(tmp_proj.first("TARGET") + projectSuffix())) << ";\n" + << "\t\t\t" << writeSettings("name", tmp_proj.first("TARGET") + projectSuffix()) << ";\n" << "\t\t\t" << writeSettings("path", pbxproj) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n" << "\t\t};\n"; @@ -283,7 +283,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) 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" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";\n" + << "\t\t\t" << writeSettings("name", grp_it.key().section(Option::dir_sep, -1)) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n" << "\t\t};\n"; } @@ -307,7 +307,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) ProString name = l.at(i); const ProKey buildKey(name + ".build"); if (!project->isEmpty(buildKey)) { - const QString build = project->values(buildKey).first().toQString(); + const QString build = project->first(buildKey).toQString(); if (build.toLower() != configName.toLower()) continue; } @@ -344,7 +344,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) t << "\t\t" << keyFor("QMAKE_SUBDIR_PBX_AGGREGATE_TARGET") << " = {\n" << "\t\t\t" << writeSettings("buildPhases", ProStringList(), SettingsAsList, 4) << ";\n" << "\t\t\tbuildSettings = {\n" - << "\t\t\t\t" << writeSettings("PRODUCT_NAME", project->values("TARGET").first()) << ";\n" + << "\t\t\t\t" << writeSettings("PRODUCT_NAME", project->first("TARGET")) << ";\n" << "\t\t\t};\n"; { ProStringList dependencies; @@ -354,8 +354,8 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) t << "\t\t\t" << writeSettings("dependencies", dependencies, SettingsAsList, 4) << ";\n" } t << "\t\t\t" << writeSettings("isa", "PBXAggregateTarget", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", project->values("TARGET").first()) << ";\n" - << "\t\t\t" << writeSettings("productName", project->values("TARGET").first()) << ";\n" + << "\t\t\t" << writeSettings("name", project->first("TARGET")) << ";\n" + << "\t\t\t" << writeSettings("productName", project->first("TARGET")) << ";\n" << "\t\t};\n"; #endif @@ -455,8 +455,8 @@ ProjectBuilderSources::files(QMakeProject *project) const { QStringList ret = project->values(ProKey(key)).toQStringList(); if(key == "QMAKE_INTERNAL_INCLUDED_FILES") { - QString qtPrefix(QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath, QLibraryInfo::EffectivePaths) + '/'); - QString qtSrcPrefix(QLibraryInfo::rawLocation(QLibraryInfo::PrefixPath, QLibraryInfo::EffectiveSourcePaths) + '/'); + QString qtPrefix(project->propertyValue(ProKey("QT_INSTALL_PREFIX/get")).toQString() + '/'); + QString qtSrcPrefix(project->propertyValue(ProKey("QT_INSTALL_PREFIX/src")).toQString() + '/'); QStringList newret; for(int i = 0; i < ret.size(); ++i) { @@ -626,8 +626,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) 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]) - file = file.mid(1, file.length()-2); if(!sources.at(source).compilerName().isNull() && !verifyExtraCompiler(sources.at(source).compilerName(), file)) continue; @@ -678,9 +676,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) //source reference t << "\t\t" << src_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("path", escapeFilePath(file)) << ";\n"; + << "\t\t\t" << writeSettings("path", file) << ";\n"; if (name != file) - t << "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";\n"; + t << "\t\t\t" << writeSettings("name", name) << ";\n"; t << "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n"; QString filetype = xcodeFiletypeForFilename(file); if (!filetype.isNull()) @@ -715,7 +713,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) 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" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp_it.key().section(Option::dir_sep, -1))) << ";\n" + << "\t\t\t" << writeSettings("name", grp_it.key().section(Option::dir_sep, -1)) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n" << "\t\t};\n"; } @@ -730,8 +728,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData()); QTextStream mkt(&mkf); writeHeader(mkt); - mkt << "MOC = " << Option::fixPathToTargetOS(var("QMAKE_MOC")) << endl; - mkt << "UIC = " << Option::fixPathToTargetOS(var("QMAKE_UIC")) << endl; + mkt << "MOC = " << var("QMAKE_MOC") << endl; + mkt << "UIC = " << var("QMAKE_UIC") << endl; mkt << "LEX = " << var("QMAKE_LEX") << endl; mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl; mkt << "YACC = " << var("QMAKE_YACC") << endl; @@ -750,30 +748,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) mkt << endl; mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl; - mkt << "IMAGES = " << varList("QMAKE_IMAGE_COLLECTION") << endl; - mkt << "PARSERS ="; - if(!project->isEmpty("YACCSOURCES")) { - 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 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(); - } - } - mkt << "\n"; - mkt << "preprocess: $(PARSERS) compilers\n"; - mkt << "clean preprocess_clean: parser_clean compiler_clean\n\n"; - mkt << "parser_clean:\n"; - if(!project->isEmpty("YACCSOURCES") || !project->isEmpty("LEXSOURCES")) - mkt << "\t-rm -f $(PARSERS)\n"; + mkt << "preprocess: compilers\n"; + mkt << "clean preprocess_clean: compiler_clean\n\n"; writeExtraTargets(mkt); if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) { mkt << "compilers:"; @@ -795,7 +771,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) mkt << "\\\n\t"; ++added; const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir); - mkt << " " << replaceExtraCompilerVariables(Option::fixPathToTargetOS(tmp_out.first().toQString(), false), file_name, QString()); + mkt << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( + replaceExtraCompilerVariables(tmp_out.first().toQString(), file_name, QString(), NoShell))); } } } @@ -844,8 +821,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) bool remove = false; 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.mid(2).toQString(); fixForOutput(r); @@ -881,10 +856,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QString librarySuffix = project->first("QMAKE_XCODE_LIBRARY_SUFFIX").toQString(); suffixSetting = "$(" + suffixSetting + ")"; if (!librarySuffix.isEmpty()) { - library = library.replace(librarySuffix, suffixSetting); - name = name.remove(librarySuffix); + library.replace(librarySuffix, suffixSetting); + name.remove(librarySuffix); } else { - library = library.replace(name, name + suffixSetting); + library.replace(name, name + suffixSetting); } } } @@ -951,14 +926,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) libdirs += path; } library = fileFixify(library); - QString filetype = xcodeFiletypeForFilename(library); QString key = keyFor(library); if (!project->values("QMAKE_PBX_LIBRARIES").contains(key)) { bool is_frmwrk = (library.endsWith(".framework")); t << "\t\t" << key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXFileReference", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(name)) << ";\n" - << "\t\t\t" << writeSettings("path", escapeFilePath(library)) << ";\n" + << "\t\t\t" << writeSettings("name", name) << ";\n" + << "\t\t\t" << writeSettings("path", library) << ";\n" << "\t\t\t" << writeSettings("refType", QString::number(reftypeForFile(library)), SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n"; if (is_frmwrk) @@ -993,14 +967,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QTextStream mkt(&mkf); writeHeader(mkt); mkt << "SUBLIBS= "; + // ### This is missing the parametrization found in unixmake2.cpp tmp = project->values("SUBLIBS"); for(int i = 0; i < tmp.count(); i++) - t << "tmp/lib" << tmp[i] << ".a "; + t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' '; t << endl << endl; mkt << "sublibs: $(SUBLIBS)\n\n"; tmp = project->values("SUBLIBS"); for(int i = 0; i < tmp.count(); i++) - t << "tmp/lib" << tmp[i] << ".a:\n\t" + t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t" << var(ProKey("MAKELIB" + tmp[i])) << endl << endl; mkt.flush(); mkf.close(); @@ -1064,7 +1039,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << key << " = {\n" << "\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("name", grp) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n" << "\t\t};\n"; } @@ -1077,7 +1052,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("files", project->values("QMAKE_PBX_BUILD_LIBRARIES"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXFrameworksBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n" + << "\t\t\t" << writeSettings("name", grp) << ";\n" << "\t\t};\n"; } @@ -1101,8 +1076,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->isEmpty("DESTDIR")) { QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE"); QString destDir = project->first("DESTDIR").toQString(); - destDir = fixForOutput(destDir); - destDir = fileInfo(Option::fixPathToLocalOS(destDir)).absoluteFilePath(); + destDir = fileInfo(Option::normalizePath(destDir)).absoluteFilePath(); project->values("QMAKE_PBX_BUILDPHASES").append(phase_key); t << "\t\t" << phase_key << " = {\n" << "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n" @@ -1113,7 +1087,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\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" + << "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + IoUtils::shellQuoteUnix(destDir))) << ";\n" << "\t\t};\n"; } bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app"; @@ -1131,13 +1105,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) //all files const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files")); for(int file = 0; file < files.count(); file++) { - QString fn = fileFixify(files[file].toQString(), Option::output_dir, input_dir, FileFixifyAbsolute); + QString fn = fileFixify(files[file].toQString(), Option::output_dir, input_dir, FileFixifyRelative); QString name = fn.split(Option::dir_sep).back(); QString file_ref_key = keyFor("QMAKE_PBX_BUNDLE_DATA_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(fn)) << ";\n" + << "\t\t\t" << writeSettings("path", fn) << ";\n" << "\t\t\t" << writeSettings("name", name) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<absolute>") << ";\n" << "\t\t};\n"; @@ -1163,7 +1137,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << phase_key << " = {\n" << "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n" << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n" + << "\t\t\t" << writeSettings("dstPath", path) << ";\n" << "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n" @@ -1187,8 +1161,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (copyBundleResources) { if (!project->isEmpty("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); bundle_resources_files += keyFor(icon + ".BUILDABLE"); } @@ -1201,7 +1173,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("files", bundle_resources_files, SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("isa", "PBXResourcesBuildPhase", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" - << "\t\t\t" << writeSettings("name", escapeFilePath(grp)) << ";\n" + << "\t\t\t" << writeSettings("name", grp) << ";\n" << "\t\t};\n"; } @@ -1226,9 +1198,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } else { t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.executable") << ";\n"; } - QString app = (!project->isEmpty("DESTDIR") ? project->first("DESTDIR") + project->first("QMAKE_ORIG_TARGET") : - qmake_getpwd()) + Option::dir_sep + targ; - t << "\t\t\t" << writeSettings("path", escapeFilePath(targ)) << ";\n"; + t << "\t\t\t" << writeSettings("path", targ) << ";\n"; } else { ProString lib = project->first("QMAKE_ORIG_TARGET"); if(project->isActiveConfig("staticlib")) { @@ -1256,7 +1226,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } else { t << "\t\t\t" << writeSettings("explicitFileType", "compiled.mach-o.dylib") << ";\n"; } - t << "\t\t\t" << writeSettings("path", escapeFilePath(lib)) << ";\n"; + t << "\t\t\t" << writeSettings("path", lib) << ";\n"; } t << "\t\t\t" << writeSettings("sourceTree", "BUILT_PRODUCTS_DIR", SettingsNoQuote) << ";\n" << "\t\t};\n"; @@ -1276,7 +1246,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t" << keyFor("QMAKE_PBX_ROOT_GROUP") << " = {\n" << "\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("name", project->first("QMAKE_ORIG_TARGET")) << ";\n" << "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n" << "\t\t};\n"; @@ -1322,14 +1292,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) else t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.tool") << ";\n"; } - 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"; + t << "\t\t\t" << writeSettings("name", project->first("QMAKE_ORIG_TARGET")) << ";\n" + << "\t\t\t" << writeSettings("productName", project->first("QMAKE_ORIG_TARGET")) << ";\n"; } else { 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" - << "\t\t\t" << writeSettings("productName", escapeFilePath(lib)) << ";\n"; + t << "\t\t\t" << writeSettings("name", lib) << ";\n" + << "\t\t\t" << writeSettings("productName", lib) << ";\n"; if (!project->isEmpty("QMAKE_PBX_PRODUCT_TYPE")) t << "\t\t\t" << writeSettings("productType", project->first("QMAKE_PBX_PRODUCT_TYPE")) << ";\n"; else if (project->isActiveConfig("staticlib")) @@ -1340,7 +1310,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t" << writeSettings("productType", "com.apple.product-type.library.dynamic") << ";\n"; } if(!project->isEmpty("DESTDIR")) - t << "\t\t\t" << writeSettings("productInstallPath", escapeFilePath(project->first("DESTDIR"))) << ";\n"; + t << "\t\t\t" << writeSettings("productInstallPath", project->first("DESTDIR")) << ";\n"; t << "\t\t};\n"; //DEBUG/RELEASE QString defaultConfig; @@ -1361,14 +1331,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProString name = l.at(i); const ProKey buildKey(name + ".build"); if (!project->isEmpty(buildKey)) { - const QString build = project->values(buildKey).first().toQString(); + const QString build = project->first(buildKey).toQString(); if (build.toLower() != configName.toLower()) continue; } 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(); + name = project->first(nkey); settings.insert(name.toQString(), value); } } @@ -1378,7 +1348,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProString lib = project->first("QMAKE_ORIG_TARGET"); if (!project->isActiveConfig("lib_bundle") && !project->isActiveConfig("staticlib")) lib.prepend("lib"); - settings.insert("PRODUCT_NAME", escapeFilePath(lib.toQString())); + settings.insert("PRODUCT_NAME", lib.toQString()); } if (project->isActiveConfig("debug") != (bool)as_release) @@ -1421,22 +1391,21 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (plist_in_file.open(QIODevice::ReadOnly)) { QTextStream plist_in(&plist_in_file); QString plist_in_text = plist_in.readAll(); - plist_in_text = plist_in_text.replace("@ICON@", + plist_in_text.replace("@ICON@", (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").toQString()); + 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").toQString()); + plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET").toQString()); } QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) bundlePrefix = "com.yourcompany"; - plist_in_text = plist_in_text.replace("@BUNDLEIDENTIFIER@", bundlePrefix + "." + QLatin1String("${PRODUCT_NAME:rfc1034identifier}")); + plist_in_text.replace("@BUNDLEIDENTIFIER@", bundlePrefix + '.' + QLatin1String("${PRODUCT_NAME:rfc1034identifier}")); if (!project->values("VERSION").isEmpty()) { - plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." + - project->first("VER_MIN")); + plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." + project->first("VER_MIN")); } - plist_in_text = plist_in_text.replace("@TYPEINFO@", + plist_in_text.replace("@TYPEINFO@", (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4).toQString())); QFile plist_out_file("Info.plist"); @@ -1449,7 +1418,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } } - t << "\t\t\t\t" << writeSettings("SYMROOT", escapeFilePath(qmake_getpwd())) << ";\n"; + t << "\t\t\t\t" << writeSettings("SYMROOT", qmake_getpwd()) << ";\n"; if (!project->isEmpty("DESTDIR")) { ProString dir = project->first("DESTDIR"); @@ -1485,11 +1454,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) 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"; + t << "\t\t\t\t" << writeSettings(var, val) << ";\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"; + << "\t\t\t\t" << writeSettings("GCC_PREFIX_HEADER", project->first("PRECOMPILED_HEADER")) << ";\n"; } t << "\t\t\t\t" << writeSettings("HEADER_SEARCH_PATHS", fixListForOutput("INCLUDEPATH"), SettingsAsList, 5) << ";\n" << "\t\t\t\t" << writeSettings("LIBRARY_SEARCH_PATHS", fixListForOutput("QMAKE_PBX_LIBPATHS"), SettingsAsList, 5) << ";\n" @@ -1520,8 +1489,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t\t" << writeSettings("OTHER_LDFLAGS", fixListForOutput("SUBLIBS") + fixListForOutput("QMAKE_LFLAGS") - + fixListForOutput("QMAKE_LIBS") - + fixListForOutput("QMAKE_LIBS_PRIVATE"), + + fixListForOutput(fixLibFlags("QMAKE_LIBS")) + + fixListForOutput(fixLibFlags("QMAKE_LIBS_PRIVATE")), SettingsAsList, 6) << ";\n"; } const ProStringList &archs = !project->values("QMAKE_XCODE_ARCHS").isEmpty() ? @@ -1529,7 +1498,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (!archs.isEmpty()) t << "\t\t\t\t" << writeSettings("ARCHS", archs) << ";\n"; if (!project->isEmpty("OBJECTS_DIR")) - t << "\t\t\t\t" << writeSettings("OBJROOT", escapeFilePath(project->first("OBJECTS_DIR").toQString())) << ";\n"; + t << "\t\t\t\t" << writeSettings("OBJROOT", project->first("OBJECTS_DIR")) << ";\n"; } else { if (project->first("TEMPLATE") == "app") { t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", fixForOutput(project->first("QMAKE_ORIG_TARGET").toQString())) << ";\n"; @@ -1541,7 +1510,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) 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"; + t << "\t\t\t\t" << writeSettings("PRODUCT_NAME", lib) << ";\n"; } } t << "\t\t\t};\n" @@ -1587,13 +1556,14 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QTextStream mkwrapt(&mkwrapf); writeHeader(mkwrapt); const char cleans[] = "preprocess_clean "; + const QString cmd = escapeFilePath(project->first("QMAKE_ORIG_TARGET") + projectSuffix() + "/") + " && " + pbxbuild(); mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n" << "all:\n\t" - << "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << "\n" + << "cd " << cmd << "\n" << "install: all\n\t" - << "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << " install\n" + << "cd " << cmd << " install\n" << "distclean clean: preprocess_clean\n\t" - << "cd " << project->first("QMAKE_ORIG_TARGET") << projectSuffix() << "/ && " << pbxbuild() << " clean\n" + << "cd " << cmd << " clean\n" << (!did_preprocess ? cleans : "") << ":\n"; if(did_preprocess) mkwrapt << cleans << ":\n\t" @@ -1693,7 +1663,6 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c output += QDir::separator(); } output += QString("project.pbxproj"); - output = unescapeFilePath(output); file.setFileName(output); } bool ret = UnixMakefileGenerator::openOutput(file, build); @@ -1750,8 +1719,6 @@ ProjectBuilderMakefileGenerator::pbuilderVersion() const else version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist"; #endif - } else { - version_plist = version_plist.replace(QRegExp("\""), ""); } if (ret.isEmpty()) { QFile version_file(version_plist); @@ -1812,7 +1779,7 @@ int ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where) { int ret = 0; //absolute is the default.. - if(QDir::isRelativePath(unescapeFilePath(where))) + if (QDir::isRelativePath(where)) ret = 4; //relative return ret; } @@ -1838,26 +1805,6 @@ ProjectBuilderMakefileGenerator::pbxbuild() return (pbuilderVersion() >= 38 ? "xcodebuild" : "pbxbuild"); } -QString -ProjectBuilderMakefileGenerator::escapeFilePath(const QString &path) const -{ -#if 1 - //in the middle of generating a Makefile! - if(writingUnixMakefileGenerator) - return UnixMakefileGenerator::escapeFilePath(path); - - //generating stuff for the xml file! - QString ret = path; - if(!ret.isEmpty()) { - ret = unescapeFilePath(ret); - debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); - } - return ret; -#else - return UnixMakefileGenerator::escapeFilePath(path); -#endif -} - static QString quotedStringLiteral(const QString &value) { QString result; |