Qt QMAKE_POST_LINK command getting mangled
<p>I have this code in my qmake (.pro) file:</p>

<pre><code># Make sure all the slashes are in the correct direction for windows
SOURCE_DIR = $${replace(_PRO_FILE_PWD_, /, \\)}\\resources\\*
TARGET_DIR = $${replace($$quote(DESTDIR), /, \\)}
message (copy1 $$SOURCE_DIR $$TARGET_DIR /y)
QMAKE_POST_LINK += copy $$SOURCE_DIR $$TARGET_DIR /y

# vvv THIS WORKS, BUT IS COMMENTED OUT vvv
#message (copy2 C:\\Users\\adadacha\\Desktop\\audioTest\\resources\\* C:\\Users\\adadacha\\Desktop\\build-TGW2AudioTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug\\targetDbg /y)
#QMAKE_POST_LINK += copy C:\\Users\\adadacha\\Desktop\\audioTest\\resources\\* C:\\Users\\adadacha\\Desktop\\build-TGW2AudioTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug\\targetDbg /y
</code></pre>

<p>So basically what this tries to achieve is copy everything from /resources/...</p>

<p>The following is the output I get. The first line is a message() function displaying exactly the command I add to QMAKE_POST_LINK (except I call it copy1 in stead of copy).
Then I see the correct copy... line getting printed by the system so I can see it looks correct. But then I see an error which shows that <code>\resources\*</code> has become <code>\resources*</code> and seems to have lost the last <code>\</code> I don't know why. I have tried to be dilligent with my <code>/ and \\</code>...</p>

<pre><code>Project MESSAGE: copy1 C:\Users\adadacha\Desktop\audioTest\resources\* C:\Users\adadacha\Desktop\build-TGW2AudioTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug\targetRel /y
    :
copy C:\Users\adadacha\Desktop\audioTest\resources\* C:\Users\adadacha\Desktop\build-TGW2AudioTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug\targetDbg /y
Makefile.Debug:167: recipe for target 'targetDbg/TGW2-AudioTest.exe' failed
process_begin: CreateProcess(NULL, copy C:\Users\adadacha\Desktop\audioTest\resources* C:\Users\adadacha\Desktop\build-TGW2AudioTest-Desktop_Qt_5_5_1_MinGW_32bit-Debug\targetDbg /y, ...) failed.
make (e=2): The system cannot find the file specified.
</code></pre>

<p>Can anyone suggest why this is occurring? Note if I copy paste the same output (as in my commented out code) it works and the end is not mangled.</p>