Make TestGUI.app work for out of source builds.

Move TestGUI.app to TestGUI.app.in (to get copied by build system)
	Make Makefile.am call ./copy_to_bundle.sh from $(srcdir)
	Make Makefile.mac handle TestGUI.app.in

Thanks to Xiaofan Chen for reporting this bug.
This commit is contained in:
Alan Ott
2012-07-08 13:01:57 -04:00
parent dee41ec751
commit 8067be7a25
11 changed files with 12 additions and 4 deletions
+2
View File
@@ -146,6 +146,8 @@ if test "x$testgui_enabled" != "xno"; then
LIBS_TESTGUI+=" -framework Cocoa -L/usr/X11R6/lib"
CFLAGS_TESTGUI+=`$foxconfig --cflags`
OBJCFLAGS+=" -x objective-c++"
mkdir -p testgui/TestGUI.app
cp -R ${srcdir}/testgui/TestGUI.app.in/ testgui/TestGUI.app
elif test "x$os" = xwindows; then
# On Windows, just set the paths for Fox toolkit
if test "x$win_implementation" = xmingw; then
+1 -1
View File
@@ -22,7 +22,7 @@ if OS_DARWIN
hidapi_testgui_SOURCES = test.cpp mac_support_cocoa.m
# Rules for copying the binary and its dependencies into the app bundle.
TestGUI.app/Contents/MacOS/hidapi-testgui$(EXEEXT): hidapi-testgui$(EXEEXT)
./copy_to_bundle.sh
$(srcdir)/copy_to_bundle.sh
all: all-am TestGUI.app/Contents/MacOS/hidapi-testgui$(EXEEXT)
+9 -3
View File
@@ -15,11 +15,12 @@ CPPOBJS=test.o
OBJCOBJS=mac_support_cocoa.o
OBJS=$(COBJS) $(CPPOBJS) $(OBJCOBJS)
CFLAGS=-I../hidapi -Wall -g -c `fox-config --cflags`
LDFLAGS=-L/usr/X11R6/lib
LIBS=`fox-config --libs` -framework IOKit -framework CoreFoundation -framework Cocoa
hidapi-testgui: $(OBJS)
g++ -Wall -g $^ $(LIBS) -o hidapi-testgui
hidapi-testgui: $(OBJS) TestGUI.app
g++ -Wall -g $(OBJS) $(LIBS) $(LDFLAGS) -o hidapi-testgui
./copy_to_bundle.sh
#cp TestGUI.app/Contents/MacOS/hidapi-testgui TestGUI.app/Contents/MacOS/tg
#cp start.sh TestGUI.app/Contents/MacOS/hidapi-testgui
@@ -33,8 +34,13 @@ $(CPPOBJS): %.o: %.cpp
$(OBJCOBJS): %.o: %.m
$(CXX) $(CFLAGS) -x objective-c++ $< -o $@
TestGUI.app: TestGUI.app.in
rm -Rf TestGUI.app
mkdir -p TestGUI.app
cp -R TestGUI.app.in/ TestGUI.app
clean:
rm $(OBJS) hidapi-testgui
rm -f $(OBJS) hidapi-testgui
rm -Rf TestGUI.app
.PHONY: clean