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:
Manolo Gouy
2016-09-03 08:14:43 +00:00
parent f84f5821b0
commit a9195a3d94
2 changed files with 5 additions and 4 deletions
+3
View File
@@ -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
View File
@@ -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,'/');