From 2cad525e2babac75395caf367449d9e9b31fcd42 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 26 Apr 2020 21:29:52 +0200 Subject: Fix out-of-tree building. --- drumgizmo/Makefile.am | 4 ++-- plugin/Makefile.am | 12 ++++++------ plugingui/Makefile.am | 7 ++++--- plugingui/rcgen.cc | 11 +++++++++++ test/Makefile.am | 4 ++-- test/dgreftest/Makefile.am | 2 +- test/uitests/Makefile.am | 23 ++++++++++++++++------- 7 files changed, 42 insertions(+), 21 deletions(-) diff --git a/drumgizmo/Makefile.am b/drumgizmo/Makefile.am index 40bddc9..c9e85b9 100644 --- a/drumgizmo/Makefile.am +++ b/drumgizmo/Makefile.am @@ -4,7 +4,7 @@ if ENABLE_CLI bin_PROGRAMS = drumgizmo dgvalidator -drumgizmo_LDADD = $(JACK_LIBS) $(top_srcdir)/src/libdg.la +drumgizmo_LDADD = $(JACK_LIBS) $(top_builddir)/src/libdg.la drumgizmo_LDFLAGS = @@ -101,7 +101,7 @@ EXTRA_DIST = \ output/oss.h \ output/wavfile.h -dgvalidator_LDADD = $(JACK_LIBS) $(top_srcdir)/src/libdg.la +dgvalidator_LDADD = $(JACK_LIBS) $(top_builddir)/src/libdg.la dgvalidator_LDFLAGS = diff --git a/plugin/Makefile.am b/plugin/Makefile.am index 078f38a..764a694 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -32,11 +32,11 @@ drumgizmo_la_SOURCES = \ drumgizmo_plugin.cc drumgizmo_la_LDFLAGS = -shared -module -avoid-version \ - -no-undefined -export-symbols drumgizmo_lv2.sym + -no-undefined -export-symbols $(top_srcdir)/plugin/drumgizmo_lv2.sym drumgizmo_la_LIBADD = $(LV2_LIBS) \ - $(top_srcdir)/plugingui/libdggui.la \ - $(top_srcdir)/src/libdg.la + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la ttlgen_CPPFLAGS = \ $(DEBUG_FLAGS) \ @@ -102,11 +102,11 @@ drumgizmo_vst_la_SOURCES = \ drumgizmo_plugin.cc drumgizmo_vst_la_LDFLAGS = -shared -module -avoid-version \ - -no-undefined -export-symbols drumgizmo_vst.sym + -no-undefined -export-symbols $(top_srcdir)/plugin/drumgizmo_vst.sym drumgizmo_vst_la_LIBADD = vst/libvstsdk.la \ - $(top_srcdir)/plugingui/libdggui.la \ - $(top_srcdir)/src/libdg.la + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la install-data-hook: diff --git a/plugingui/Makefile.am b/plugingui/Makefile.am index 91e95bf..10bf23a 100644 --- a/plugingui/Makefile.am +++ b/plugingui/Makefile.am @@ -33,11 +33,12 @@ RES = \ ../BUGS \ ../COPYING -resource_data.cc : rcgen $(RES) - ./rcgen $(RES) > resource_data.cc +resource_data.cc: rcgen $(RES) + ./rcgen -d $(top_srcdir)/plugingui $(RES) > $(top_srcdir)/plugingui/resource_data.cc libdggui_la_CPPFLAGS = \ $(DEBUG_FLAGS) \ + -I$(top_srcdir) \ $(GUI_CPPFLAGS) \ -I$(top_srcdir)/hugin \ -I$(top_srcdir)/src \ @@ -163,7 +164,7 @@ libdggui_la_CPPFLAGS += \ -I$(top_srcdir)/pugl endif -plugingui_LDADD = libdggui.la $(top_srcdir)/src/libdg.la +plugingui_LDADD = libdggui.la $(top_builddir)/src/libdg.la plugingui_CXXFLAGS = \ $(DEBUG_FLAGS) \ diff --git a/plugingui/rcgen.cc b/plugingui/rcgen.cc index a30f7b4..f4d7fe6 100644 --- a/plugingui/rcgen.cc +++ b/plugingui/rcgen.cc @@ -26,6 +26,7 @@ */ #include #include +#include int main(int argc, char *argv[]) { @@ -36,6 +37,16 @@ int main(int argc, char *argv[]) printf("{\n"); int i = 1; + + if(argc > 2 && std::string(argv[1]) == "-d") + { + if(chdir(argv[2])) + { + return 1; + } + i += 2; + } + while(i < argc) { printf(" {\n \":%s\", ", argv[i]); diff --git a/test/Makefile.am b/test/Makefile.am index 8332cbe..001d13d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -98,7 +98,7 @@ enginetest_CXXFLAGS = -DOUTPUT=\"enginetest\" \ -I$(top_srcdir)/src \ -I$(top_srcdir)/hugin $(PTHREAD_CFLAGS) $(SNDFILE_CFLAGS) enginetest_LDFLAGS = $(PTHREAD_LIBS) $(SNDFILE_LIBS) \ - $(top_srcdir)/src/libdg.la + $(top_builddir)/src/libdg.la enginetest_SOURCES = \ $(top_srcdir)/hugin/hugin.c \ dgtest.cc \ @@ -229,7 +229,7 @@ domloadertest_CXXFLAGS = -DOUTPUT=\"domloadertest\" \ $(DEBUG_FLAGS) \ -I$(top_srcdir)/src domloadertest_LDFLAGS = \ - $(top_srcdir)/src/libdg.la + $(top_builddir)/src/libdg.la domloadertest_SOURCES = \ $(top_srcdir)/hugin/hugin.c \ domloadertest.cc \ diff --git a/test/dgreftest/Makefile.am b/test/dgreftest/Makefile.am index 12e5303..d89a53a 100644 --- a/test/dgreftest/Makefile.am +++ b/test/dgreftest/Makefile.am @@ -4,7 +4,7 @@ if HAVE_INPUT_MIDIFILE noinst_PROGRAMS = dgreftest dgreftest_LDADD = $(PTHREAD_LIBS) $(JACK_LIBS) \ - $(SMF_LIBS) $(top_srcdir)/src/libdg.la + $(SMF_LIBS) $(top_builddir)/src/libdg.la dgreftest_LDFLAGS = diff --git a/test/uitests/Makefile.am b/test/uitests/Makefile.am index 0c6821e..bd2c6d1 100644 --- a/test/uitests/Makefile.am +++ b/test/uitests/Makefile.am @@ -1,7 +1,9 @@ noinst_PROGRAMS = resizetest tabwidgettest framewidgettest \ filebrowsertest benchmarktest -resizetest_LDADD = $(top_srcdir)/plugingui/libdggui.la $(top_srcdir)/src/libdg.la +resizetest_LDADD = \ + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la resizetest_CXXFLAGS = \ -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/src \ @@ -10,7 +12,9 @@ resizetest_SOURCES = \ resizetest.cc \ $(top_srcdir)/hugin/hugin.c -tabwidgettest_LDADD = $(top_srcdir)/plugingui/libdggui.la $(top_srcdir)/src/libdg.la +tabwidgettest_LDADD = \ + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la tabwidgettest_CXXFLAGS = \ -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/src \ @@ -19,7 +23,9 @@ tabwidgettest_SOURCES = \ tabwidgettest.cc \ $(top_srcdir)/hugin/hugin.c -filebrowsertest_LDADD = $(top_srcdir)/plugingui/libdggui.la $(top_srcdir)/src/libdg.la +filebrowsertest_LDADD = \ + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la filebrowsertest_CXXFLAGS = \ -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/src \ @@ -28,7 +34,9 @@ filebrowsertest_SOURCES = \ filebrowsertest.cc \ $(top_srcdir)/hugin/hugin.c -framewidgettest_LDADD = $(top_srcdir)/plugingui/libdggui.la $(top_srcdir)/src/libdg.la +framewidgettest_LDADD = \ + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la framewidgettest_CXXFLAGS = \ -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/src \ @@ -43,11 +51,12 @@ RES = \ benchmarktest_resources/image_edge_alpha.png \ benchmarktest_resources/image_inner_alpha.png -benchmarktest_resource_data.cc : $(top_srcdir)/plugingui/rcgen $(RES) - $(top_srcdir)/plugingui/rcgen $(RES) > benchmarktest_resource_data.cc +benchmarktest_resource_data.cc: $(top_builddir)/plugingui/rcgen $(RES) + $(top_builddir)/plugingui/rcgen -d $(top_srcdir)/test/uitests $(RES) > $(top_srcdir)/test/uitests/benchmarktest_resource_data.cc benchmarktest_LDADD = \ - $(top_srcdir)/plugingui/libdggui.la $(top_srcdir)/src/libdg.la + $(top_builddir)/plugingui/libdggui.la \ + $(top_builddir)/src/libdg.la benchmarktest_CXXFLAGS = \ -I$(top_srcdir)/plugingui \ -I$(top_srcdir)/src \ -- cgit v1.2.3