mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Revert commit b284a21fee (VS: Add missing label in C# project-build
events, 2021-09-03, v3.22.0-rc1~156^2). The change broke cases using
multiple successful custom commands. Revert it pending further
investigation into the interaction of the generated script code with
`Microsoft.Common.CurrentVersion.targets`, and whether this is needed
for all managed projects or just C# projects.
Also add a test covering the case that was broken.
Fixes: #22964
Issue: #21440
16 lines
591 B
CMake
16 lines
591 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
project(VSManagedCustomCommand CXX)
|
|
|
|
add_custom_command(OUTPUT middle.txt
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/example.txt ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
|
|
)
|
|
|
|
add_custom_command(OUTPUT example.cxx
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/middle.txt ${CMAKE_CURRENT_BINARY_DIR}/example.cxx
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
|
|
)
|
|
|
|
add_library(example SHARED example.cxx)
|
|
set_property(TARGET example PROPERTY COMMON_LANGUAGE_RUNTIME "")
|