Automatic translation in qmake's project?
Hi, my problem may be unusual:
I have project that use subdirs project model and lupdate & lrelease doesn't work on it.
I want make pro files for subprojects in a way that building subprojects would also make translations.
I already have additional targets translate that does whole work.
The thing i can't figure out is how to force projects target to be dependent on additional target.
Re: Automatic translation in qmake's project?
Can we see the project file?
Re: Automatic translation in qmake's project?
I'm at work at the moment and i didn't copied updated pro file from home pc
its usual project with additional lines like
update.commands = lupdate hellotr.pro
updates.depends = $$SOURCES $$HEADERS $$FORMS $$TRANSLATIONS
release.commands = lrelease hellotr.pro
release.depends = update
translate.commands = $(COPY) *.qm ${DESTDIR}
translate.depends = release
QMAKE_EXTRA_TARGETS += update release translate
so make translate updates ts files, releases qms and copies them to destination directory
I want it to be done when normal make release / make debug is called.
i found that adding
POST_TARGETDEPS += translate
causes it works as i want, but qt documentation says that POST_TARGETDEPS may not work on some backends and looking for another way to do it without POST_TARGETDEPS portability limitations.
Re: Automatic translation in qmake's project?
I would suggest using a custom target not related to make release or make debug. It doesn't make much sense to update (and above all to release) the translations during every compilation.
Re: Automatic translation in qmake's project?
But if i use 'make translate' on subdirs template, 'translate' target will be passed to subproject's makes?
Re: Automatic translation in qmake's project?
If you set the "recursive" option to translate.CONFIG then yes.
Re: Automatic translation in qmake's project?
I've checked it and it works, thanks.
however i can't find it in any documentation...
Re: Automatic translation in qmake's project?
Well... it's one of those undocumented things :) You can learn more by exploring our wiki.