Skip to content

Commit 86a339d

Browse files
authored
ios add system frameworks to the project (#498)
1 parent 236309f commit 86a339d

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

commandLine/src/projects/baseProject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#define PG_VERSION "35"
3+
#define PG_VERSION "37"
44

55
#include "ofAddon.h"
66
#include "ofFileUtils.h"

commandLine/src/projects/xcodeProject.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,16 @@ void xcodeProject::addFramework(const fs::path & path, const fs::path & folder){
365365
// folder = the path in the addon (in case we want to add this to the file browser -- we don't do that for system libs);
366366

367367
addCommand("# ----- addFramework path=" + ofPathToString(path) + " folder=" + ofPathToString(folder));
368+
// alert("# ----- addFramework path=" + ofPathToString(path) + " folder=" + ofPathToString(folder));
368369

369370
bool isSystemFramework = true;
370371
if (!folder.empty() && !ofIsStringInString(ofPathToString(path), "/System/Library/Frameworks")
371372
&& target != "ios"){
372373
isSystemFramework = false;
373374
}
374375

376+
// alert ("isSystem? " + ofToString(isSystemFramework), 31);
377+
375378
fileProperties fp;
376379
fp.addToBuildPhase = true;
377380
fp.codeSignOnCopy = !isSystemFramework;
@@ -572,7 +575,6 @@ void xcodeProject::addAddon(ofAddon & addon){
572575
}
573576

574577
for (auto & f : addon.frameworks) {
575-
// alert ("xcodeproj addon.frameworks : " + f);
576578
ofLogVerbose() << "adding addon frameworks: " << f;
577579

578580
size_t found=f.find('/');
@@ -772,11 +774,11 @@ string xcodeProject::addFile(const fs::path & path, const fs::path & folder, con
772774
addCommand("Add :objects:"+UUID+":sourceTree string SOURCE_ROOT");
773775
addCommand("Add :objects:"+UUID+":lastKnownFileType string " + fileType);
774776
addCommand("Add :objects:"+UUID+":path string " + ofPathToString(path));
775-
777+
addCommand("Add :objects:"+UUID+":name string " + ofPathToString(path.filename()));
778+
776779
string folderUUID;
777780
if (fp.isSrc) {
778-
string name = ofPathToString(path.filename());
779-
addCommand("Add :objects:"+UUID+":name string " + name);
781+
// addCommand("Add :objects:"+UUID+":name string " + ofPathToString(path.filename()));
780782

781783
// fs::path base;
782784
// fs::path src { path };
@@ -845,10 +847,9 @@ string xcodeProject::addFile(const fs::path & path, const fs::path & folder, con
845847
}
846848

847849
if (fp.addToBuildResource) {
848-
string mediaAssetsUUID = "9936F60E1BFA4DEE00891288";
850+
string mediaAssetsUUID { "9936F60E1BFA4DEE00891288" };
849851
addCommand("# ---- addToBuildResource");
850852
addCommand("Add :objects:"+mediaAssetsUUID+":files: string " + UUID);
851-
852853
}
853854

854855
if (fp.addToResources) {
@@ -862,8 +863,18 @@ string xcodeProject::addFile(const fs::path & path, const fs::path & folder, con
862863
if (fp.frameworksBuildPhase) {
863864
addCommand("# ---- frameworksBuildPhase " + buildUUID);
864865
addCommand("Add :objects:E4B69B590A3A1756003C02F2:files: string " + buildUUID);
866+
}
867+
868+
if (path.extension() == ".framework") {
869+
addCommand("# ---- Frameworks Folder " + UUID);
870+
addCommand("Add :objects:901808C02053638E004A7774:children: string " + UUID);
871+
872+
addCommand("# ---- PBXFrameworksBuildPhase " + buildUUID);
873+
addCommand("Add :objects:1D60588F0D05DD3D006BFB54:files: string " + buildUUID);
865874

866875
}
876+
877+
867878
debugCommands = false;
868879
}
869880
return UUID;

0 commit comments

Comments
 (0)