From 34fdd5988feb4e78c554e800533173abebfe0ea4 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Fri, 28 Mar 2025 19:22:32 -0300 Subject: [PATCH 1/2] ok, now projects inside OF folder but in arbitrary depth work --- commandLine/src/defines.h | 2 +- commandLine/src/projects/xcodeProject.cpp | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) 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..a34e03e9 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -222,12 +222,25 @@ bool xcodeProject::loadProjectFile() { //base // if ofRoot is not relative to the project path, // set correct addons and openFrameworks folders + + 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; From 2ac2852100ac4297a67af9335d7d16fae74f7fbe Mon Sep 17 00:00:00 2001 From: Dimitre Date: Fri, 28 Mar 2025 19:33:07 -0300 Subject: [PATCH 2/2] cleanup --- commandLine/src/projects/xcodeProject.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index a34e03e9..7abb2bc3 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -220,11 +220,10 @@ 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())) { updateOFPath = true; @@ -237,7 +236,6 @@ bool xcodeProject::loadProjectFile() { //base 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");