diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index ba4c9fd3..eab0b331 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ #define OFPROJECTGENERATOR_MAJOR_VERSION "0" -#define OFPROJECTGENERATOR_MINOR_VERSION "101" +#define OFPROJECTGENERATOR_MINOR_VERSION "102" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index 49eb0443..7abb2bc3 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -220,14 +220,25 @@ bool xcodeProject::loadProjectFile() { //base addCommand("Set :objects:E4B69B5B0A3A1756003C02F2:path string " + projectName + "Debug.app"); } - // if ofRoot is not relative to the project path, - // set correct addons and openFrameworks folders + // Next block updates ofPath in xcode addons and openframeworks folder + // only if it is not the usual ../../.. path + + bool updateOFPath = false; + fs::path of = getOFRoot(); if (!ofIsPathInPath(fs::current_path(), getOFRoot())) { - addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":path string " + getOFRoot().string() + "/libs/openFrameworks"); + updateOFPath = true; addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":sourceTree string "); - - addCommand("Set :objects:" + folderUUID["addons"] + ":path string " + getOFRoot().string() + "/addons"); addCommand("Set :objects:" + folderUUID["addons"] + ":sourceTree string "); + } else { + // inside OF Root but not in usual depth + if (!fs::equivalent(getOFRoot(), "../../..")) { + updateOFPath = true; + of = fs::relative(getOFRoot(), fs::current_path()); + } + } + if (updateOFPath) { + addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":path string " + of.string() + "/libs/openFrameworks"); + addCommand("Set :objects:" + folderUUID["addons"] + ":path string " + of.string() + "/addons"); } return true;