How can I get QMAKE_POST_LINK to work with more than one command on Windows?

When using multiple commands with QMAKE_POST_LINK e.g.

  1. QMAKE_POST_LINK += copy ..\file.lib ..\..\lib\
  2. QMAKE_POST_LINK += copy ..\file2.lib ..\..\lib\

qmake tries to put them all on the same line, with the result that it fails to execute more than the first command.

The solution is to add $$escape_expand(\n\t) to the end of each QMAKE_POST_LINK entry.

This was tested and functions correctly with nmake using the Microsoft build environment.

1 comment

December 14, 2011

Picture of moorepe moorepe

Lab Rat

I believe that you can also enter the && to seperate the lines.

QMAKE_POST_LINK += copy ..\file.lib ..\..\lib\ && copy ..\file.lib ..\..\lib\

there is also the $${QMAKE_COPY} will be system independent.

its copy /y on windows and cp -f on unix

Write a comment

Sorry, you must be logged in to post a comment.