File/installation paths: osx (cocoa & carbon) update in ghost
[blender.git] / intern / ghost / intern / GHOST_SystemCarbon.cpp
index 977745589ebf28d6b7e7b2feadf3a3d5566373fc..ecdc03b43479f0bb8bb9ec4e26f32d0c7e6afdd3 100644 (file)
@@ -1238,5 +1238,15 @@ const GHOST_TUns8* GHOST_SystemCarbon::getUserDir() const
 
 const GHOST_TUns8* GHOST_SystemCarbon::getBinaryDir() const
 {
-       return NULL;
+       CFURLRef bundleURL;
+       CFStringRef pathStr;
+       static char path[256];
+       CFBundleRef mainBundle = CFBundleGetMainBundle();
+       
+       bundleURL = CFBundleCopyBundleURL(mainBundle);
+       pathStr = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle);
+       CFStringGetCString(pathStr, path, 255, kCFStringEncodingASCII);
+       CFRelease(pathStr);
+       CFRelease(bundleURL);
+       return (GHOST_TUns8*)path;
 }