How to execute a PowerShell script only before a web deploy Publish task in VS 2012?

It depends on how you define before but below is one technique. When you create a publish profile with VS2012 it will create you a .pubxml file in the Properties\PublishProfiles folder (My Project\PublishProfiles for VB). These are MSBuild files and you can edit them to customize the publish process. In your case you can inject … Read more

Copy target file to another location in a post build step in CMake

Rather than using the obsolete LOCATION property, prefer using generator expressions: add_custom_command(TARGET mylibrary POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:mylibrary> ${targetfile} ) You could also just generate the exe in the target directory directly by setting the target property RUNTIME_OUTPUT_DIRECTORY instead of copying it. This has per-configuration options (e.g. RUNTIME_OUTPUT_DIRECTORY_DEBUG). set_target_properties(mylibrary PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG <debug path> RUNTIME_OUTPUT_DIRECTORY_RELEASE … Read more