aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_project
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2015-04-09 19:25:57 +0200
committerEinar Johan Trøan Sømåen2015-04-09 20:02:18 +0200
commitf4a9f2035b3c67051772be76d6b16cbd2a5daea5 (patch)
tree272ef051454f8bf6e65ac494881d3512bc71cbf2 /devtools/create_project
parent1f13d42c6b4981e26df5342e2804f3bcdf70ad73 (diff)
downloadscummvm-rg350-f4a9f2035b3c67051772be76d6b16cbd2a5daea5.tar.gz
scummvm-rg350-f4a9f2035b3c67051772be76d6b16cbd2a5daea5.tar.bz2
scummvm-rg350-f4a9f2035b3c67051772be76d6b16cbd2a5daea5.zip
CREATE_PROJECT: Add the product files to a group in XCode aswell (makes things easier when configuring build-schemes)
Diffstat (limited to 'devtools/create_project')
-rw-r--r--devtools/create_project/xcode.cpp16
-rw-r--r--devtools/create_project/xcode.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 4628cf9de9..ef156830e1 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -189,6 +189,16 @@ void XCodeProvider::addFileReference(const std::string &id, const std::string &n
_fileReference.flags = SettingsSingleItem;
}
+void XCodeProvider::addProductFileReference(const std::string &id, const std::string &name) {
+ Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
+ fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", SettingsNoValue|SettingsQuoteVariable);
+ fileRef->addProperty("includeInIndex", "0", "", SettingsNoValue);
+ fileRef->addProperty("path", name, "", SettingsNoValue|SettingsQuoteVariable);
+ fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue);
+ _fileReference.add(fileRef);
+ _fileReference.flags = SettingsSingleItem;
+}
+
void XCodeProvider::addBuildFile(const std::string &id, const std::string &name, const std::string &fileRefId, const std::string &comment) {
Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment);
@@ -499,6 +509,8 @@ void XCodeProvider::setupFrameworksBuildPhase() {
void XCodeProvider::setupNativeTarget() {
_nativeTarget.comment = "PBXNativeTarget";
+ // Just use a hardcoded id for the Products-group
+ Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , "");
// Output native target section
for (unsigned int i = 0; i < _targets.size(); i++) {
#ifndef ENABLE_IOS
@@ -524,11 +536,15 @@ void XCodeProvider::setupNativeTarget() {
target->addProperty("name", _targets[i], "", SettingsNoValue|SettingsQuoteVariable);
target->addProperty("productName", PROJECT_NAME, "", SettingsNoValue);
+ addProductFileReference("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i], PROJECT_DESCRIPTION ".app");
+ productsGroup->addChildByHash(getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app");
target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", SettingsNoValue);
target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue|SettingsQuoteVariable);
_nativeTarget.add(target);
}
+ _rootSourceGroup->addChildGroup(productsGroup);
+ _groups.add(productsGroup);
}
void XCodeProvider::setupProject() {
diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h
index 792fa06d8b..7b16bd2dd1 100644
--- a/devtools/create_project/xcode.h
+++ b/devtools/create_project/xcode.h
@@ -286,6 +286,7 @@ private:
Group *touchGroupsForPath(const std::string &path);
// Functionality for adding file-refs and build-files, as Group-objects need to be able to do this.
void addFileReference(const std::string &id, const std::string &name, FileProperty properties);
+ void addProductFileReference(const std::string &id, const std::string &name);
void addBuildFile(const std::string &id, const std::string &name, const std::string &fileRefId, const std::string &comment);
// All objects
std::map<std::string, std::string> _hashDictionnary;