--- src/graph/graphqt.cpp.orig	Thu Jul 15 19:59:53 2004
+++ src/graph/graphqt.cpp	Sat Nov  6 20:12:21 2004
@@ -1320,9 +1320,19 @@
 		return;
 	}
 
-	/* try the current location (look for "lib") */
+	/* try the current location, or on Mac OS X, in the app bundle (look for "lib") */
 	infstr = initinfstr();
+#ifdef MACOSX
+	CFURLRef bundleRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+	CFStringRef macPath = CFURLCopyFileSystemPath(bundleRef, kCFURLPOSIXPathStyle);
+	const char *pathPtr = CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding());
+	addstringtoinfstr(infstr, pathPtr);
+	addstringtoinfstr(infstr, "/Contents/");
+	CFRelease(macPath);
+	CFRelease(bundleRef);
+#else
 	addstringtoinfstr(infstr, currentdirectory());
+#endif
 	addstringtoinfstr(infstr, "lib/");
 	addstringtoinfstr(infstr, CADRCFILENAME);
 	pt = returninfstr(infstr);
