mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 13:10:17 -06:00
Tests: Update CustomCommandWorkingDirectory to handle in-source byproducts
When running an in-source build the CustomCommandWorkingDirectory test created a copy of a source file in the same directory it was running on. This breaks when byproducts are cleaned (e.g. via Ninja) because it deletes one of the source files.
This commit is contained in:
@@ -9,17 +9,17 @@ add_custom_command(
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
"${TestWorkingDir_BINARY_DIR}/customTarget.c"
|
||||
"${TestWorkingDir_BINARY_DIR}/customTarget1.c"
|
||||
"${TestWorkingDir_BINARY_DIR}/customTarget2.c"
|
||||
PROPERTIES GENERATED 1)
|
||||
|
||||
add_executable(working "${TestWorkingDir_BINARY_DIR}/working.c"
|
||||
"${TestWorkingDir_BINARY_DIR}/customTarget.c")
|
||||
"${TestWorkingDir_BINARY_DIR}/customTarget1.c")
|
||||
|
||||
add_custom_target(
|
||||
Custom ALL
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c"
|
||||
BYPRODUCTS "${TestWorkingDir_BINARY_DIR}/customTarget.c"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget1.c"
|
||||
BYPRODUCTS "${TestWorkingDir_BINARY_DIR}/customTarget1.c"
|
||||
WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user