mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix ui_%.h building to .uic
This rearranges things so that all the ui-generated headers are put in .uic and found by the buildsystem the right way<tm> Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
218c0956e2
commit
292b9aed48
1 changed files with 9 additions and 15 deletions
24
Rules.mk
24
Rules.mk
|
@ -39,8 +39,9 @@ MOC_OBJS = $(HEADERS_NEEDING_MOC:.h=.moc.o)
|
||||||
ALL_OBJS = $(OBJS) $(MOC_OBJS)
|
ALL_OBJS = $(OBJS) $(MOC_OBJS)
|
||||||
|
|
||||||
# handling of uic
|
# handling of uic
|
||||||
UIC_HEADERS = $(patsubst %.ui, ui_%.h, $(subst qt-ui/,,$(FORMS)))
|
UIC_HEADERS = $(patsubst qt-ui/%.ui, .uic/ui_%.h, $(FORMS))
|
||||||
vpath %.ui qt-ui
|
# Needs to exist before we add path
|
||||||
|
$(shell mkdir -p .uic)
|
||||||
vpath ui_%.h .uic
|
vpath ui_%.h .uic
|
||||||
|
|
||||||
# Files for using Qt Creator
|
# Files for using Qt Creator
|
||||||
|
@ -187,7 +188,7 @@ MOCFLAGS = $(filter -I%, $(CXXFLAGS) $(EXTRA_FLAGS)) $(filter -D%, $(CXXFLAGS) $
|
||||||
@mkdir -p .dep/$(@D)
|
@mkdir -p .dep/$(@D)
|
||||||
$(COMPILE_PREFIX)$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
|
$(COMPILE_PREFIX)$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
|
||||||
|
|
||||||
%.o: %.cpp $(UIC_HEADERS)
|
%.o: %.cpp
|
||||||
@$(PRETTYECHO) ' CXX' $<
|
@$(PRETTYECHO) ' CXX' $<
|
||||||
@mkdir -p .dep/$(@D)
|
@mkdir -p .dep/$(@D)
|
||||||
$(COMPILE_PREFIX)$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -I.uic -Iqt-ui -MD -MF .dep/$@.dep -c -o $@ $<
|
$(COMPILE_PREFIX)$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -I.uic -Iqt-ui -MD -MF .dep/$@.dep -c -o $@ $<
|
||||||
|
@ -211,18 +212,11 @@ MOCFLAGS = $(filter -I%, $(CXXFLAGS) $(EXTRA_FLAGS)) $(filter -D%, $(CXXFLAGS) $
|
||||||
$(COMPILE_PREFIX)$(RCC) $< -o $@
|
$(COMPILE_PREFIX)$(RCC) $< -o $@
|
||||||
%.qrc:
|
%.qrc:
|
||||||
|
|
||||||
# This creates the ui headers.
|
# Create the .ui headers in .uic searched by vpath
|
||||||
ui_%.h: %.ui .uic
|
# Added to include path in cpp rule
|
||||||
|
.uic/ui_%.h: qt-ui/%.ui
|
||||||
@$(PRETTYECHO) ' UIC' $<
|
@$(PRETTYECHO) ' UIC' $<
|
||||||
@mkdir -p .uic/qt-ui
|
$(COMPILE_PREFIX)$(UIC) $< -o $@
|
||||||
$(COMPILE_PREFIX)$(UIC) $< -o .uic/$@
|
|
||||||
|
|
||||||
# This forces the creation of ui headers with the wrong path
|
|
||||||
# This is required because the -MG option to the compiler outputs
|
|
||||||
# unknown files with no path prefix
|
|
||||||
ui_%.h: qt-ui/%.ui
|
|
||||||
@$(PRETTYECHO) ' UIC' $<
|
|
||||||
$(COMPILE_PREFIX)$(UIC) $< -o qt-ui/$@
|
|
||||||
|
|
||||||
share/locale/%.UTF-8/LC_MESSAGES/$(NAME).mo: po/%.po po/%.aliases
|
share/locale/%.UTF-8/LC_MESSAGES/$(NAME).mo: po/%.po po/%.aliases
|
||||||
@$(PRETTYECHO) ' MSGFMT' $*.po
|
@$(PRETTYECHO) ' MSGFMT' $*.po
|
||||||
|
@ -254,7 +248,7 @@ clean:
|
||||||
rm -f $(ALL_OBJS) *~ $(NAME) $(VERSION_FILE) \
|
rm -f $(ALL_OBJS) *~ $(NAME) $(VERSION_FILE) \
|
||||||
$(NAME).exe po/*~ po/$(NAME)-new.pot \
|
$(NAME).exe po/*~ po/$(NAME)-new.pot \
|
||||||
*.moc qt-ui/*.moc \
|
*.moc qt-ui/*.moc \
|
||||||
$(UIC_HEADERS:%=qt-ui/%) .uic/*.h \
|
.uic/*.h \
|
||||||
$(RESOURCES:.qrc=.qrc.cpp)
|
$(RESOURCES:.qrc=.qrc.cpp)
|
||||||
rm -rf share
|
rm -rf share
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue