Never mind. Sometimes it is bad to work late at night. I had convinced
myself the following did not work.
For the record, here's the fixed makefile
On Tue, 31 Mar 2009, dherr...@ll.mit.edu wrote:
I'm using Qt 4's moc to generate source files in an autotools project.
The pattern looks something like
cat <<_EOF > Makefile.am
# Makefile fragment
bin_PROGRAMS=test
test_SOURCES=a.cpp b.cpp
test_META=a.hpp b.hpp
test_SOURCES+=$(test_META)
test_LDADD = $(test_META:%.hpp=%_moc.$(OBJEXT))
%_moc.cpp : %.hpp
$(QT_MOC) -o $@ $<
$(DEPDIR)/%_moc.Po :
@touch $@
include $(test_META:%.hpp=$(DEPDIR)/%_moc.Po)
_EOF
The main problem with this is that it spews warnings about missing deps
files the first time make is run. It would be nice to properly hook into
configure's depfiles command to avoid these warnings. Likewise configure
is generating a bogus file named ".deps/$(test_META:%.hpp=%_moc.Po".
Otherwise it seems to work.
Later,
Daniel