int main(int argc, char **argv)
{
- return Msp::Application::run(argc, argv);
+ void *data = 0;
+
+#ifdef __APPLE__
+ /* Applications launched from Finder get a special argument, which would
+ interfere with GetOpt. Remove it from argv but pass it as data so it can
+ be used to determine how the application was launhed. */
+ int j = 0;
+ for(int i=0; i<argc; ++i)
+ {
+ if(!strncmp(argv[i], "-psn_", 5))
+ data = argv[i];
+ else
+ argv[j++] = argv[i];
+ }
+ argc = j;
+ argv[j] = 0;
+#endif
+
+ return Msp::Application::run(argc, argv, data);
}
if(dir[-1]=="bin" || dir[-1]=="sbin")
return dir/".."/"share"/appname;
+ else if(dir[-1]=="MacOS")
+ return dir/".."/"Resources";
else
return dir;
}