why are Xcode projects addons paths relative to the project instead of OF_PATH? #7351
Replies: 5 comments 16 replies
-
Yes I think we should go for the second. what is needed? changing the template or projectGenerator too? |
Beta Was this translation helpful? Give feedback.
-
ah indeed it seems to be PG that constructs those links -- but i'm not sure i've never looked at the PG code (i have a bit of an Electron problem...). it seems limited to the addon paths; the core OF stuff is OF_PATH based. [edit: but maybe there is a (perhaps historical) reason for that behaviour? that was may question as such] |
Beta Was this translation helpful? Give feedback.
-
just a note that the paths in an OF project are generally always relative, but not location dependent Ie, I don't think you see this unless you make a project outside of the OF folder ../../../../../home/source/openFrameworks/addons/ofxX/src but more relative to the root of OF -- ie, like this: I am honestly not so familiar with how it might work with $(OF_PATH) -- but the idea was to make it easy to move OF, and also to make it easy for you to share projects. You just need to think about the relative path to the root of OF for where the project is located. I think we want to avoid something where projects break the movement you move the OF folder or that projects break when you move machines or share projects with someone else. |
Beta Was this translation helpful? Give feedback.
-
is there an authoritative guide on how to get PG to build? most docs (including INSTALL_FROM_GITHUB.md) mostly say "ah... hm, yeah, don't bother and grab one from a release". i'm a bit confused about the hierarchy -- trying to build within the OF root seems to trigger a russia-doll download of OF; trying to treat the project commandLine as an OF project and run it in PG gives a "local addon" error. trying the instructions here fail at (as i understand things: in order to perform the above tweaks i do not need the GUI version, but i still need to build the commandline). |
Beta Was this translation helpful? Give feedback.
-
so, as far as Xcode/macOS goes, the core libs are defined in the OF tree with the $OF_PATH variable, ex glm: these libs path populate $OF_CORE_LIBS, and are pushed as "other linker flags" into the Xcode project by the project's .xcconfig which comes from the template: so that's more or less statically defined by the combination of the Xcode template, and the CoreOF.xcconfig and ends up as: now the addon are treated by the commandline PG, and they are configured as per a relative path based on the project's position (slightly counter-intuitive as the addons are relative to OF, but this makes a strange ping-pong between the project source, OF itself, and then the addon directory): changing that line 276 from results in paths that look like this: and suddenly, by simply editing the OF_PATH at the top of the project's .xcconfig, your project can be swapped between OF trees (or computers) without a trip to the ProjectGenerator (so, preserving all settings, etc.) without depending on that "relative depth". my question: changing baseProject.cpp affects all platforms. is there a drawback to rely on OF_PATH on other platforms? i see the qbs template does not call |
Beta Was this translation helpful? Give feedback.
-
why a location-dependent
../../../../../home/source/openFrameworks/addons/ofxX/src
instead of
$(OF_PATH)/addons/ofxX/src
Beta Was this translation helpful? Give feedback.
All reactions