summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.unix11
-rw-r--r--qmake/Makefile.win322
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp66
-rw-r--r--qmake/generators/unix/unixmake.cpp9
-rw-r--r--qmake/generators/unix/unixmake2.cpp102
5 files changed, 143 insertions, 47 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index ffbd0d4545..b9c967c3c7 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -18,7 +18,7 @@ QOBJS=qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtext
qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o \
qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o \
qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o \
- qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o \
+ qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o qoperatingsystemversion.o \
qjson.o qjsondocument.o qjsonparser.o qjsonarray.o qjsonobject.o qjsonvalue.o \
$(QTOBJS)
@@ -272,6 +272,15 @@ qmetatype.o: $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
qcore_mac.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp
+qoperatingsystemversion.o: $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion.cpp
+
+qoperatingsystemversion_win.o: $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_win.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_win.cpp
+
+qoperatingsystemversion_darwin.o: $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_darwin.mm
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_darwin.mm
+
qcore_mac_objc.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_mac_objc.mm
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/kernel/qcore_mac_objc.mm
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index fc225ff098..971b6db84d 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -105,6 +105,8 @@ QTOBJS= \
qlocale_win.obj \
qmalloc.obj \
qmap.obj \
+ qoperatingsystemversion.obj \
+ qoperatingsystemversion_win.obj \
qregexp.obj \
qtextcodec.obj \
qutfcodec.obj \
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 85a5ba56c3..e602734155 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1113,6 +1113,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app";
ProStringList bundle_resources_files;
+ ProStringList embedded_frameworks;
+ QMap<ProString, ProStringList> embedded_plugins;
// Copy Bundle Data
if (!project->isEmpty("QMAKE_BUNDLE_DATA")) {
ProStringList bundle_file_refs;
@@ -1123,6 +1125,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
for(int i = 0; i < bundle_data.count(); i++) {
ProStringList bundle_files;
ProString path = project->first(ProKey(bundle_data[i] + ".path"));
+ const bool isEmbeddedFramework = ((!osx && path == QLatin1String("Frameworks"))
+ || (osx && path == QLatin1String("Contents/Frameworks")));
+ const ProString pluginsPrefix = ProString(osx ? QLatin1String("Contents/PlugIns") : QLatin1String("PlugIns"));
+ const bool isEmbeddedPlugin = (path == pluginsPrefix) || path.startsWith(pluginsPrefix + "/");
+
//all files
const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
for(int file = 0; file < files.count(); file++) {
@@ -1140,19 +1147,29 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
bundle_files += file_key;
t << "\t\t" << file_key << " = {\n"
<< "\t\t\t" << writeSettings("fileRef", file_ref_key) << ";\n"
- << "\t\t\t" << writeSettings("isa", "PBXBuildFile", SettingsNoQuote) << ";\n"
- << "\t\t};\n";
+ << "\t\t\t" << writeSettings("isa", "PBXBuildFile", SettingsNoQuote) << ";\n";
+ if (isEmbeddedFramework || isEmbeddedPlugin || name.endsWith(".dylib") || name.endsWith(".framework"))
+ t << "\t\t\t" << writeSettings("settings", "{ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }", SettingsNoQuote) << ";\n";
+ t << "\t\t};\n";
}
if (copyBundleResources && ((!osx && path.isEmpty())
|| (osx && path == QLatin1String("Contents/Resources")))) {
for (const ProString &s : qAsConst(bundle_files))
bundle_resources_files << s;
+ } else if (copyBundleResources && isEmbeddedFramework) {
+ for (const ProString &s : qAsConst(bundle_files))
+ embedded_frameworks << s;
+ } else if (copyBundleResources && isEmbeddedPlugin) {
+ for (const ProString &s : qAsConst(bundle_files)) {
+ ProString subpath = (path == pluginsPrefix) ? ProString() : path.mid(pluginsPrefix.size() + 1);
+ embedded_plugins[subpath] << s;
+ }
} else {
QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]);
- if (!project->isEmpty(ProKey(bundle_data[i] + ".version"))) {
- //###
- }
+ //if (!project->isActiveConfig("shallow_bundle")
+ // && !project->isEmpty(ProKey(bundle_data[i] + ".version"))) {
+ //}
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n"
@@ -1196,6 +1213,35 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", grp) << ";\n"
<< "\t\t};\n";
+
+ QString grp2("Embed Frameworks"), key2 = keyFor(grp2);
+ project->values("QMAKE_PBX_BUILDPHASES").append(key2);
+ t << "\t\t" << key2 << " = {\n"
+ << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("dstPath", "") << ";\n"
+ << "\t\t\t" << writeSettings("dstSubfolderSpec", "10", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("files", embedded_frameworks, SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("name", grp2) << ";\n"
+ << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
+ << "\t\t};\n";
+
+ QMapIterator<ProString, ProStringList> it(embedded_plugins);
+ while (it.hasNext()) {
+ it.next();
+ QString suffix = !it.key().isEmpty() ? (" (" + it.key() + ")") : QString();
+ QString grp3("Embed PlugIns" + suffix), key3 = keyFor(grp3);
+ project->values("QMAKE_PBX_BUILDPHASES").append(key3);
+ t << "\t\t" << key3 << " = {\n"
+ << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("dstPath", it.key()) << ";\n"
+ << "\t\t\t" << writeSettings("dstSubfolderSpec", "13", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("files", it.value(), SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("name", grp3) << ";\n"
+ << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
+ << "\t\t};\n";
+ }
}
//REFERENCE
@@ -1515,9 +1561,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
plist_in_text.replace(QLatin1String("@ICON@"),
(project->isEmpty("ICON") ? QString("") : project->first("ICON").toQString().section(Option::dir_sep, -1)));
if (project->first("TEMPLATE") == "app") {
- plist_in_text.replace(QLatin1String("@EXECUTABLE@"), project->first("QMAKE_ORIG_TARGET").toQString());
+ ProString app_bundle_name = project->first("QMAKE_APPLICATION_BUNDLE_NAME");
+ if (app_bundle_name.isEmpty())
+ app_bundle_name = project->first("QMAKE_ORIG_TARGET");
+ plist_in_text.replace(QLatin1String("@EXECUTABLE@"), app_bundle_name.toQString());
} else {
- plist_in_text.replace(QLatin1String("@LIBRARY@"), project->first("QMAKE_ORIG_TARGET").toQString());
+ ProString lib_bundle_name = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME");
+ if (lib_bundle_name.isEmpty())
+ lib_bundle_name = project->first("QMAKE_ORIG_TARGET");
+ plist_in_text.replace(QLatin1String("@LIBRARY@"), lib_bundle_name.toQString());
}
QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty())
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 349dcd2f40..794d04a6e9 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -599,10 +599,13 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
plain_targ = escapeFilePath(plain_targ);
if (bundle != NoBundle) {
QString suffix;
- if (project->first("TEMPLATE") == "lib")
- suffix = "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/$(TARGET)";
- else
+ if (project->first("TEMPLATE") == "lib") {
+ if (!project->isActiveConfig("shallow_bundle"))
+ suffix += "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION");
+ suffix += "/$(TARGET)";
+ } else {
suffix = "/" + project->first("QMAKE_BUNDLE_LOCATION") + "/$(QMAKE_TARGET)";
+ }
dst_targ += suffix;
if (bundle == SolidBundle) {
if (!ret.isEmpty())
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 6fa355390f..3d12ffd65c 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -596,9 +596,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGETD)`\"", false) << "\n\t"
<< "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)\n\t"
- << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t"
- << varGlue("QMAKE_LN_SHLIB", "-", " ",
- " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
+ << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t";
+ if (!project->isActiveConfig("shallow_bundle"))
+ t << varGlue("QMAKE_LN_SHLIB", "-", " ",
+ " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
@@ -777,10 +778,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} else {
info_plist = escapeFilePath(fileFixify(info_plist));
}
- bool isFramework = project->first("TEMPLATE") == "lib" && project->isActiveConfig("lib_bundle");
+ bool isFramework = project->first("TEMPLATE") == "lib"
+ && !project->isActiveConfig("plugin")
+ && project->isActiveConfig("lib_bundle");
+ bool isShallowBundle = project->isActiveConfig("shallow_bundle");
QString info_plist_out = bundle_dir +
- (isFramework ? ("Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/Resources/Info.plist")
- : "Contents/Info.plist");
+ (!isShallowBundle
+ ? (isFramework
+ ? ("Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/Resources/")
+ : "Contents/")
+ : QString())
+ + "Info.plist";
bundledFiles << info_plist_out;
alldeps << info_plist_out;
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
@@ -814,14 +822,22 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
if (!isFramework) {
+ ProString app_bundle_name = var("QMAKE_APPLICATION_BUNDLE_NAME");
+ if (app_bundle_name.isEmpty())
+ app_bundle_name = var("QMAKE_ORIG_TARGET");
+
+ ProString plugin_bundle_name = var("QMAKE_PLUGIN_BUNDLE_NAME");
+ if (plugin_bundle_name.isEmpty())
+ plugin_bundle_name = var("QMAKE_ORIG_TARGET");
+
QString icon = fileFixify(var("ICON"));
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
for (const ProString &arg : qAsConst(commonSedArgs))
t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
- << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
- << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
+ << "-e \"s,@EXECUTABLE@," << app_bundle_name << ",g\" "
+ << "-e \"s,@LIBRARY@," << plugin_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl;
@@ -838,12 +854,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl;
}
} else {
- symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources";
+ ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME");
+ if (lib_bundle_name.isEmpty())
+ lib_bundle_name = var("QMAKE_ORIG_TARGET");
+
+ if (!isShallowBundle)
+ symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources";
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
for (const ProString &arg : qAsConst(commonSedArgs))
t << arg;
- t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
+ t << "-e \"s,@LIBRARY@," << lib_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@,"
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
@@ -857,18 +878,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(int i = 0; i < bundle_data.count(); i++) {
const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
QString path = bundle_dir;
- 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") + "/";
- ProString name = project->first(pkey);
- int pos = name.indexOf('/');
- if (pos > 0)
- name = name.mid(0, pos);
- symlinks[Option::fixPathToTargetOS(path + name)] =
- project->first(vkey) + "/Current/" + name;
- path += version;
+ if (!project->isActiveConfig("shallow_bundle")) {
+ const ProKey vkey(bundle_data[i] + ".version");
+ if (!project->isEmpty(vkey)) {
+ QString version = project->first(vkey) + "/" +
+ project->first("QMAKE_FRAMEWORK_VERSION") + "/";
+ ProString name = project->first(pkey);
+ int pos = name.indexOf('/');
+ if (pos > 0)
+ name = name.mid(0, pos);
+ symlinks[Option::fixPathToTargetOS(path + name)] =
+ project->first(vkey) + "/Current/" + name;
+ path += version;
+ }
}
path += project->first(pkey).toQString();
path = Option::fixPathToTargetOS(path);
@@ -906,15 +929,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
}
- QString currentLink = bundle_dir + "Versions/Current";
- QString currentLink_f = escapeDependencyPath(currentLink);
- bundledFiles << currentLink;
- alldeps << currentLink;
- t << currentLink_f << ": $(MAKEFILE)\n\t"
- << mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
- << "@-$(DEL_FILE) " << currentLink_f << "\n\t"
- << "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
- << ' ' << currentLink_f << endl;
+ if (!project->isActiveConfig("shallow_bundle")) {
+ QString currentLink = bundle_dir + "Versions/Current";
+ QString currentLink_f = escapeDependencyPath(currentLink);
+ bundledFiles << currentLink;
+ alldeps << currentLink;
+ t << currentLink_f << ": $(MAKEFILE)\n\t"
+ << mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
+ << "@-$(DEL_FILE) " << currentLink_f << "\n\t"
+ << "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
+ << ' ' << currentLink_f << endl;
+ }
}
}
@@ -1186,12 +1211,17 @@ void UnixMakefileGenerator::init2()
bundle_loc.prepend("/");
if(!bundle_loc.endsWith("/"))
bundle_loc += "/";
- project->values("TARGET_").append(project->first("QMAKE_BUNDLE") +
- bundle_loc + project->first("TARGET"));
- project->values("TARGET_x.y").append(project->first("QMAKE_BUNDLE") +
- "/Versions/" +
- project->first("QMAKE_FRAMEWORK_VERSION") +
- bundle_loc + project->first("TARGET"));
+ const QString target = project->first("QMAKE_BUNDLE") +
+ bundle_loc + project->first("TARGET");
+ project->values("TARGET_").append(target);
+ if (!project->isActiveConfig("shallow_bundle")) {
+ project->values("TARGET_x.y").append(project->first("QMAKE_BUNDLE") +
+ "/Versions/" +
+ project->first("QMAKE_FRAMEWORK_VERSION") +
+ bundle_loc + project->first("TARGET"));
+ } else {
+ project->values("TARGET_x.y").append(target);
+ }
} else if(project->isActiveConfig("plugin")) {
QString prefix;
if(!project->isActiveConfig("no_plugin_name_prefix"))