Index: src/vortex.c =================================================================== --- src/vortex.c (revision 3316) +++ src/vortex.c (working copy) @@ -45,6 +45,10 @@ #define LOG_DOMAIN "vortex" +#if defined(AXL_OS_DARWIN) +static void mac_add_resource_path(void); +#endif + /** * @internal * @@ -907,6 +911,11 @@ vortex_support_add_search_path_ref (vortex_support_build_filename (PACKAGE_TOP_DIR, "libvortex", "data", NULL)); vortex_support_add_search_path_ref (vortex_support_build_filename (PACKAGE_TOP_DIR, "data", NULL)); #endif + +#if defined(AXL_OS_DARWIN) + mac_add_resource_path(); +#endif + /* do not use the add_search_path_ref version to force vortex library to perform a local copy path */ vortex_support_add_search_path ("."); @@ -1146,6 +1155,25 @@ return; } + + +#if defined(AXL_OS_DARWIN) +#include +static void mac_add_resource_path(void) { + CFBundleRef frameworkBundle = CFBundleGetBundleWithIdentifier(CFSTR("es.aspl.vortex.Vortex")); + if( frameworkBundle ) { + CFURLRef url = CFBundleCopyResourcesDirectoryURL(frameworkBundle); + char rsrcPath[1024]; + CFURLGetFileSystemRepresentation(url, true, (UInt8*)rsrcPath, sizeof(rsrcPath)); + CFRelease(url); + vortex_support_add_search_path(rsrcPath); + vortex_log (LOG_DOMAIN, VORTEX_LEVEL_DEBUG,"Added framework search path %s",rsrcPath); + } else + vortex_log (LOG_DOMAIN, VORTEX_LEVEL_WARNING,"Couldn't find framework bundle"); +} +#endif + + /* @} */