All

I have Qt project which contains **.ts-file** and **.qrc-file** containing reference to generated **.qm-file**. We do not store .qm-files in our version control system. The issue here is that when I check out source code and run "make", I'm getting error

Qt Code:
  1. RCC: Error in 'CoreGeneral.qrc': Cannot find file 'core.general_en.qm'
To copy to clipboard, switch view to plain text mode 

I created updateqm.pri files to get .qm files generated before build, this file I include to my .pro files

Qt Code:
  1. !contains(QMAKE_EXTRA_COMPILERS, updateqm) {
  2. updateqm.input = TRANSLATIONS
  3. updateqm.output = ${QMAKE_FILE_BASE}.qm
  4. updateqm.commands = $$[QT_INSTALL_BINS]/lrelease -idbased ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_BASE}.qm
  5. updateqm.CONFIG += no_link target_predeps
  6. QMAKE_EXTRA_COMPILERS += updateqm
  7. PRE_TARGETDEPS += compiler_updateqm_make_all
  8. }
To copy to clipboard, switch view to plain text mode 

But again, I'm getting this error, though .qm files eventually get generated.
Compile output looks like this

Qt Code:
  1. C:\Qt\Qt5.2.1\5.2.1\msvc2012\bin\lrelease -idbased core.general_en.ts -qm core.general_en.qm
  2. C:\Qt\Qt5.2.1\5.2.1\msvc2012\bin\uic.exe PSGHTMLDisplay.ui -o GeneratedFiles\ui_PSGHTMLDisplay.h
  3. C:\Qt\Qt5.2.1\5.2.1\msvc2012\bin\rcc.exe -name CoreGeneral CoreGeneral.qrc -o GeneratedFiles\qrc_CoreGeneral.cpp
  4. RCC: Error in 'CoreGeneral.qrc': Cannot find file 'core.general_en.qm'
  5.  
  6. Updating 'core.general_en.qm'...
  7. Generated 108 translation(s) (0 finished and 108 unfinished)
To copy to clipboard, switch view to plain text mode 

So, for me it looks like RCC starts processing .qrc file before lrelease finished generating .qm-files.

Is there any approach to avoid this issue?

**P.S.** I tried using QMAKE_EXTRA_TARGETS to create pre-build event that will be generating .qm-files before any other target will be started but it didn't work for me. I used approach described here "link":http://blog.mgsxx.com/?p=2180

Briefly, the approach of creating pre-build event is like below

Qt Code:
  1. # создаем файл-заглушку
  2. !exists($$OUT_PWD/.beforebuild) {
  3. system(@echo aaa > $$system_path($${OUT_PWD}/.beforebuild))
  4. }
  5.  
  6. QMAKE_EXTRA_TARGETS += before_build makefilehook
  7.  
  8. makefilehook.target = $(MAKEFILE)
  9. makefilehook.depends = .beforebuild
  10.  
  11. POST_TARGETDEPS += .beforebuild
  12.  
  13. before_build.target = .beforebuild
  14. before_build.depends = FORCE
  15. before_build.commands = @echo our command
To copy to clipboard, switch view to plain text mode