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. --- plugingui/Makefile.am | 7 ++++--- plugingui/rcgen.cc | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'plugingui') 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]); -- cgit v1.2.3