Hi

The title already says what my question is about: I want to add a custom compiler which produces output another target depends on.

This is my code:
Qt Code:
  1. !equals(ffmpegpath, "") {
  2. WINDOWS_ICONS = resources/icons/hicolor/128x128/apps/$${projectname}.png
  3. windowsicon.name = windowsicon
  4. windowsicon.input = WINDOWS_ICONS
  5. windowsicon.output = "$${OUT_PWD}/res/windowsicon_${QMAKE_FILE_BASE}.ico"
  6. windowsicon.commands = $${ffmpegpath} -y -i ${QMAKE_FILE_IN} -vf crop=iw-20:ih-20:10:10,scale=64:64 "$${OUT_PWD}/res/windowsicon_${QMAKE_FILE_BASE}.ico"
  7. windowsicon.CONFIG = no_link target_predeps
  8. QMAKE_EXTRA_COMPILERS += windowsicon
  9. PRE_TARGETDEPS += compiler_windowsicon_make_all # I added this line because the configuration "target_predeps" somehow doesn't work
  10. RC_ICONS = $${OUT_PWD}/res/windowsicon_$${projectname}.ico
  11. }
To copy to clipboard, switch view to plain text mode 
As you can see, this code generates the Windows icon with ffmpeg. This actually works.

The problem comes when trying to compile with the -j option for parallel execution of jobs.

The compilation fails here
Qt Code:
  1. Makefile.Release:135: recipe for target 'obj/passwordmanager_resource_res.o' failed
  2. make[1]: *** [obj/passwordmanager_resource_res.o] Error 1
To copy to clipboard, switch view to plain text mode 
because
Qt Code:
  1. i686-w64-mingw32-windres: can't open icon file `/build/mingw-w64-passwordmanager/src/passwordmanager/build-i686-w64-mingw32/res/windowsic
  2. co': No such file or directory
To copy to clipboard, switch view to plain text mode 
Obviously the build order is important and make tries to do the target 'obj/passwordmanager_resource_res.o' before the target of the additional compiler is done (which seems to be called 'compiler_windowsicon_make_all').
How can I add 'compiler_windowsicon_make_all' as a dependency of 'obj/passwordmanager_resource_res.o' so make knows the right order?

I've already fiddled some time with qmake but had no success.

Thanks for your help.