mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 02:46:34 +08:00
MacOS platform: make configure-based build produce a bundled demo app in test.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11918 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -334,6 +334,9 @@ curve$(EXEEXT): curve.o
|
|||||||
demo$(EXEEXT): demo.o
|
demo$(EXEEXT): demo.o
|
||||||
echo Linking $@...
|
echo Linking $@...
|
||||||
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ demo.o $(LINKFLTKFORMS) $(LDLIBS)
|
$(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ demo.o $(LINKFLTKFORMS) $(LDLIBS)
|
||||||
|
$(OSX_ONLY) ../fltk-config --post $@
|
||||||
|
$(OSX_ONLY) mkdir -p demo.app/Contents/Resources
|
||||||
|
$(OSX_ONLY) cp -f demo.menu demo.app/Contents/Resources/
|
||||||
|
|
||||||
device$(EXEEXT): device.o $(IMGLIBNAME)
|
device$(EXEEXT): device.o $(IMGLIBNAME)
|
||||||
echo Linking $@...
|
echo Linking $@...
|
||||||
|
|||||||
+2
-4
@@ -296,7 +296,7 @@ void dobut(Fl_Widget *, long arg)
|
|||||||
char command[2048], path[2048], app_path[2048];
|
char command[2048], path[2048], app_path[2048];
|
||||||
|
|
||||||
// this neat little block of code ensures that the current directory
|
// this neat little block of code ensures that the current directory
|
||||||
// is set to the location of the Demo application.
|
// is set to the location of the Demo bundled application.
|
||||||
CFBundleRef app = CFBundleGetMainBundle();
|
CFBundleRef app = CFBundleGetMainBundle();
|
||||||
CFURLRef url = CFBundleCopyBundleURL(app);
|
CFURLRef url = CFBundleCopyBundleURL(app);
|
||||||
CFStringRef cc_app_path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
|
CFStringRef cc_app_path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
|
||||||
@@ -306,9 +306,7 @@ void dobut(Fl_Widget *, long arg)
|
|||||||
if (*app_path) {
|
if (*app_path) {
|
||||||
char *n = strrchr(app_path, '/');
|
char *n = strrchr(app_path, '/');
|
||||||
if (n) {
|
if (n) {
|
||||||
#if defined USING_XCODE
|
|
||||||
*n = 0;
|
*n = 0;
|
||||||
#endif
|
|
||||||
chdir(app_path);
|
chdir(app_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,7 +366,7 @@ int load_the_menu(char* fname)
|
|||||||
char line[256], mname[64],iname[64],cname[64];
|
char line[256], mname[64],iname[64],cname[64];
|
||||||
int i, j;
|
int i, j;
|
||||||
fin = fl_fopen(fname,"r");
|
fin = fl_fopen(fname,"r");
|
||||||
#if defined ( USING_XCODE )
|
#if defined ( __APPLE__ )
|
||||||
if (fin == NULL) {
|
if (fin == NULL) {
|
||||||
// mac os bundle menu detection:
|
// mac os bundle menu detection:
|
||||||
char* pos = strrchr(fname,'/');
|
char* pos = strrchr(fname,'/');
|
||||||
|
|||||||
Reference in New Issue
Block a user