1

I want to run

add_custom_command(TARGET ProjectName POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory "SRC" "DEST" COMMENT "My Custom message")

only when visual studio compiles the project in debug configuration. If the project is being compiled in Release mode then I dont want to copy this particular directory. How do I implement such cases using cmake.

  • What worked for me is this: `add_custom_command(TARGET ProjectName POST_BUILD COMMAND "$<$:${CMAKE_COMMAND};-E;copy_directory;\"SRC\";\"DEST\">" COMMAND_EXPAND_LISTS COMMENT "My Custom message")` – Anant Gupta Oct 07 '21 at 12:09

0 Answers0