I am using an info.plist in Xcode to set the Environmental Variables, DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH.
I am setting DYLD_LIBRARY_PATH to
$CONTENTS_FOLDER_PATH/runtime/1.1.0:$CONTENTS_FOLDER_PATH/modules/tiapp/1.1.0:$CONTENTS_FOLDER_PATH/modules/ticodec/1.1.0:$CONTENTS_FOLDER_PATH/modules/tidatabase/1.1.0:$CONTENTS_FOLDER_PATH/modules/tifilesystem/1.1.0:$CONTENTS_FOLDER_PATH/modules/timedia/1.1.0:$CONTENTS_FOLDER_PATH/modules/timonkey/1.1.0:$CONTENTS_FOLDER_PATH/modules/tinetwork/1.1.0:$CONTENTS_FOLDER_PATH/modules/tiplatform/1.1.0:$CONTENTS_FOLDER_PATH/modules/tiprocess/1.1.0:$CONTENTS_FOLDER_PATH/modules/tiui/1.1.0:$CONTENTS_FOLDER_PATH/modules/tiworker/1.1.0
and
DYLD_FRAMEWORK_PATH to
$CONTENTS_FOLDER_PATH/runtime/1.1.0
And when I double click my .app folder dlopen can’t find any of my .dylib that are referenced in the folders above.
If I take the same exact variables and paths and place them in my Executable Arguments in Xcode, everything works fine, but only if I run the software through Xcode, and I need everything to work when you click on the .app folder.
What am I doing wrong in the info.plist? Does it not like the $CONTENTS_FOLDER_PATH? Does it need a different delimiter? Why does the same arguments work in the Executable Arguments but not in the info.plist file?
Thanks in advance.
I ended up using the @rpath to find all my dylibs and frameworks. I rebuilt all frameworks and libraries with the install name of @rpath/-name of library or framework-.
Then I added in the main project’s run search path settings relative path names like @loader_path/../runtime/1.1.0 and @loader_path/../modules/, etc…
This allows dlopen call to find the current path without using plist or executable arguments.