2018-09-06 03:10:54 +00:00
|
|
|
include Makefile.common
|
|
|
|
|
|
|
|
# Qt MOC generation, required for QObject-derived classes
|
|
|
|
ifneq ($(MOC_HEADERS),)
|
|
|
|
# prefix moc_ to base filename of paths and change extension from h to cpp, so a/b/foo.h becomes a/b/moc_foo.cpp
|
|
|
|
MOC_SRC := $(join $(addsuffix moc_,$(dir $(MOC_HEADERS))), $(notdir $(MOC_HEADERS:.h=.cpp)))
|
|
|
|
endif
|
|
|
|
|
2018-09-08 03:32:57 +00:00
|
|
|
MOC ?= $(error missing moc path)
|
2018-09-06 03:10:54 +00:00
|
|
|
|
|
|
|
.PHONY: generate
|
|
|
|
|
|
|
|
$(MOC_SRC):
|
|
|
|
@$(if $(Q), $(shell echo echo MOC $<),)
|
|
|
|
$(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@))
|
2018-09-08 03:32:57 +00:00
|
|
|
$(MOC) -o $(MOC_TMP) $<
|
2018-09-06 03:10:54 +00:00
|
|
|
|
|
|
|
$(foreach x,$(join $(addsuffix :,$(MOC_SRC)),$(MOC_HEADERS)),$(eval $x))
|
|
|
|
|
|
|
|
generate: $(MOC_SRC)
|
|
|
|
@echo $(MOC_SRC)
|
|
|
|
|
|
|
|
print-%:
|
|
|
|
@echo '$*=$($*)'
|