title: Convert Unix path to windows in QMake Script
body: <p>Is there anyway to get the windows style path to the directory containing the <code>.pro</code> or convert what is stored in <code>_PRO_FILE_PWD_</code> to a Windows style path ?</p>
  
  <hr>
  
  <p>I have an issue with the <code>_PRO_FILE_PWD_</code> variable in Qmake where it returns a unix style path on windows.</p>
  
  <p>e.g <code>c:/foo/bar</code> instead of <code>c:\foo\bar</code></p>
  
  <p>This is proving a problem where the path is being used as part of a post link step.</p>
  
  <pre><code>QMAKE_POST_LINK += copy /y $$[QT_INSTALL_BINS]\\QtCore4.dll  $${_PRO_FILE_PWD_}/bin/;
  </code></pre>
  
  <p>I use the <code>.pro</code> file to create a Visual Studio project and I can see that if I manually change the forward slashes to back slashes in VS that everything is copied fine without any errors.</p>
  
  <p>I get the following error in Visual Studio if I don't correct the path.</p>
  
  <pre><code>PostBuildEvent:
  1&gt;  Description: copy /y C:\Qt\4.8.3\bin\QtCore4.dll E:/foo/build/win32//bin//;
  1&gt;  The syntax of the command is incorrect.
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command "copy /y C:\Qt\4.8.3\bin\QtCore4.dll E:/foo/build/win32/bin/;
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code 1.
  </code></pre>
  
  <hr>
  
  <p><strong>Solution</strong></p>
  
  <p>Very simple solution thanks to Roku by adding escaped double quotes around the path using / characters.</p>
  
  <pre><code>MAKE_POST_LINK += 
      copy /y $$[QT_INSTALL_BINS]\\QtCore4.dll \"$${_PRO_FILE_PWD_}/bin/\";  
  </code></pre>
  
  <p>Note for addingi multiple copy commands you must seperate them with the ampersand the semicolon doesn't work. </p>
  
  <p>e.g.</p>
  
  <pre><code> MAKE_POST_LINK += 
          copy /y $$[QT_INSTALL_BINS]\\QtCore4.dll \"$${_PRO_FILE_PWD_}/bin/\" &amp;
      MAKE_POST_LINK += 
          copy /y $$[QT_INSTALL_BINS]\\QtGui4.dll \"$${_PRO_FILE_PWD_}/bin/\";  
  </code></pre>