How to create PostBuild event with CMake only for one configuration (with multi-configuration generator)?
Currently, I have something similar to
cmake_minimum_required(VERSION 3.8) # or any version
project(MyProject)
add_executable(app main.cpp)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_custom_command(TARGET app POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "This is a post-build step in Release mode."
)
endif()
But that only works for non multi-configuration generator (so ignored by Visual Studio).