diff --git a/Makefile.am b/Makefile.am index e8e42cac..637f3509 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ EXTRA_DIST = m4/expansions.m4 -SUBDIRS = src examples +SUBDIRS = src examples qt if ENABLE_DEBUG SUBDIRS += tests diff --git a/autogen.sh b/autogen.sh index 1aa2ec76..43165c47 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,6 @@ #! /bin/sh -PROJECT=CPPInterop +PROJECT=cxxi FILE= CONFIGURE=configure.ac diff --git a/configure.ac b/configure.ac index 94d8e46b..3045c816 100644 --- a/configure.ac +++ b/configure.ac @@ -63,12 +63,10 @@ dnl package checks, per config AC_CONFIG_FILES([ src/Mono.Cxxi/mono.cxxi.pc src/Mono.Cxxi/Makefile -src/QtBindings/qtbindings.pc -src/QtBindings/Makefile src/generator/generator src/generator/Makefile -src/qt/Makefile src/Makefile +qt/Makefile tests/Makefile examples/Makefile examples/Hello/Makefile diff --git a/qt/Makefile.am b/qt/Makefile.am index 19485b5d..772b9a62 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,29 +1,42 @@ -top_srcdir = ../.. +top_srcdir = .. INTEROP_DLL = \ $(top_srcdir)/bin/Debug/Mono.Cxxi.dll +HANDWRITTEN = \ + QString.cs \ + QApplication.cs \ + QCoreApplication.cs \ + QSize.cs \ + QPushButton.cs + all: hello.exe +# HACK: some Mac versions of Qt don't play nice with pkg-config +QT_FLAGS := `pkg-config --silence-errors --cflags QtCore QtGui || \ + (ln -s /Library/Frameworks/QtGui.framework/Versions/Current/Headers QtGui && \ + ln -s /Library/Frameworks/QtCore.framework/Versions/Current/Headers QtCore && \ + echo "-m32 -I. -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers")` + qt-gui.xml: qt-gui.h - $(GCCXML) -fxml=$@ --gccxml-cxxflags "-m32 -I." /Library/Frameworks/QtGui.framework/Versions/Current/Headers/QtGui + $(GCCXML) -fxml=$@ --gccxml-cxxflags $(QT_FLAGS) $^ -generated: qt-gui.xml +generated: qt-gui-filters.xml qt-gui.xml $(RM) -r generated - $(MONO) --debug $(top_srcdir)/bin/Debug/generator.exe -o=generated -ns=Qt.Gui -lib=QtGui --filters=qt-gui-filters.txt qt-gui.xml + $(MONO) --debug $(top_srcdir)/bin/Debug/generator.exe -o=generated -ns=Qt.Gui -lib=QtGui --filters=$^ #libQtGui-inline.so: qt-gui.cpp # $(CXX) -m32 -I. -framework QtGui -framework QtCore -DQ_WS_MAC --shared -fPIC -o $@ -fkeep-inline-functions qt-gui.cpp -Qt.Gui-binding.dll: generated QString.cs QSize.cs QApplication.cs QCoreApplication.cs +Qt.Gui-binding.dll: generated $(addprefix src/,$(HANDWRITTEN)) $(RM) -f generated/QString.cs generated/QSize.cs - $(GMCS) -debug -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs QString.cs QApplication.cs QCoreApplication.cs QSize.cs + $(GMCS) -debug -out:$@ -target:library -unsafe -r:$(INTEROP_DLL) generated/*.cs $(addprefix src/,$(HANDWRITTEN)) -hello.exe: Qt.Gui-binding.dll hello.cs #libQtGui-inline.so - $(GMCS) -debug -out:$@ -target:exe -r:$(INTEROP_DLL) -r:Qt.Gui-binding.dll hello.cs +hello.exe: Qt.Gui-binding.dll demos/hello.cs #libQtGui-inline.so + $(GMCS) -debug -out:$@ -target:exe -r:$(INTEROP_DLL) -r:Qt.Gui-binding.dll demos/hello.cs clean: - $(RM) -rf generated hello.exe* qt-gui.xml Qt.Gui-binding.dll* libQtGui-inline.so + $(RM) -r generated QtCore QtGui hello.exe* qt-gui.xml Qt.Gui-binding.dll* libQtGui-inline.so run: hello.exe - MONO_PATH=.:$(top_srcdir)/bin/Debug $(MONO) --debug --trace=__CppLibraryImplAssembly hello.exe + MONO_PATH=.:$(top_srcdir)/bin/Debug $(MONO) --debug hello.exe