title: How to use add_custom_command to copy dlls using generator expressions?
body: <p>I have to copy dll's in my solution at the compile time , so i am using add_custom_command for that as follows:</p>
  
  <pre><code>function(dll_dependencies TEST_CASE )
  foreach(depencency ${ARGN})        
      add_custom_command(TARGET ${TEST_CASE} POST_BUILD
          COMMAND ${CMAKE_COMMAND} -E copy
          $&lt;DLL_FILE_NAME:${depencency}&gt;)
  endforeach()
  endfunction()
  </code></pre>
  
  <p>and in the cmakelist.txt i am calling the above function as:</p>
  
  <pre><code>dll_dependencies(performance QT5::Core QT5::FileSystem)
  </code></pre>
  
  <p>but i am getting error as :</p>
  
  <pre><code>Error evaluating generator expression:
  $&lt;DLL_FILE_NAME:QT5::Core&gt;
  
  Error evaluating generator expression:
  $&lt;DLL_FILE_NAME:QT5::FileSystem&gt;
  </code></pre>
  
  <p>So, i am not getting wether its not able to reach to the location of where qt related stuff is installed or am i doing mistake in the add_custom_command generator expression?
  I want the function to be so generic that whatever dll i want to get in the solution is placed inside the target during compilation.</p>