Skip to content

Commit 34fdd59

Browse files
committed
ok, now projects inside OF folder but in arbitrary depth work
1 parent 5501ffa commit 34fdd59

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

commandLine/src/defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
2-
#define OFPROJECTGENERATOR_MINOR_VERSION "101"
2+
#define OFPROJECTGENERATOR_MINOR_VERSION "102"
33
#define OFPROJECTGENERATOR_PATCH_VERSION "0"
44

55
#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)

commandLine/src/projects/xcodeProject.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,25 @@ bool xcodeProject::loadProjectFile() { //base
222222

223223
// if ofRoot is not relative to the project path,
224224
// set correct addons and openFrameworks folders
225+
226+
bool updateOFPath = false;
227+
228+
fs::path of = getOFRoot();
225229
if (!ofIsPathInPath(fs::current_path(), getOFRoot())) {
226-
addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":path string " + getOFRoot().string() + "/libs/openFrameworks");
230+
updateOFPath = true;
227231
addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":sourceTree string <absolute>");
228-
229-
addCommand("Set :objects:" + folderUUID["addons"] + ":path string " + getOFRoot().string() + "/addons");
230232
addCommand("Set :objects:" + folderUUID["addons"] + ":sourceTree string <absolute>");
233+
} else {
234+
// inside OF Root but not in usual depth
235+
if (!fs::equivalent(getOFRoot(), "../../..")) {
236+
updateOFPath = true;
237+
of = fs::relative(getOFRoot(), fs::current_path());
238+
}
239+
}
240+
241+
if (updateOFPath) {
242+
addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":path string " + of.string() + "/libs/openFrameworks");
243+
addCommand("Set :objects:" + folderUUID["addons"] + ":path string " + of.string() + "/addons");
231244
}
232245

233246
return true;

0 commit comments

Comments
 (0)