title: How to set a post build command to VS project from cmake?
body: <p>I need to set this post-build event in cmake</p>
  <p>how to do this?</p>
  <p>I am using below command in my vs project, but I need to add it during CMake build in <strong>Cmakelists.txt</strong></p>
  <pre><code>xcopy /y /d &quot;$(TargetPath)&quot; &quot;$(ProjectDir)$(Platform)\$(Configuration)&quot; 
  </code></pre>
  <p>I tried following but they didn't work for me VS cannot find the path</p>
  <p><a href="https://stackoverflow.com/questions/10671916/how-to-copy-dll-files-into-the-same-folder-as-the-executable-using-cmake">How to copy DLL files into the same folder as the executable using CMake?</a></p>
  <p><a href="https://stackoverflow.com/questions/40696990/cmake-post-build-event-copy-compiled-libraries">CMake post-build-event: copy compiled libraries</a></p>
  <pre><code>add_custom_command(
      TARGET my 
      POST_BUILD        
      COMMAND ${CMAKE_COMMAND} xcopy /y /d &quot;$(TargetPath)&quot; &quot;$(ProjectDir)$(Platform)\$(Configuration)&quot; 
  ) 
  </code></pre>
  <p>error --&gt; this $(ProjectDir)$(Platform)$(Configuration) not giving right path it shows x64Debug not x64\Debug</p>