I would like to add the following command only for the Debug configuration:
if (MSVC)
add_custom_command(TARGET my_target PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${src} ${dst})
endif()
src
and dst
are just path strings.
I tried to adapt the code using examples I've seen in related answers here, here and here. But non of them worked. Either the specific case is slightly different or they simply execute the same command using a different argument for other configurations. All of my adaptations attempts caused the command to be malformed or simply did not do the trick.
I would like other configurations to not have to add a command at all.
How can this simple task be achieved?