From 9c2b393cb7750cf182e765f679f9876851aa5055 Mon Sep 17 00:00:00 2001 From: Pedro Navarro Date: Thu, 27 Sep 2018 16:57:51 -0700 Subject: 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. --- Tests/CustomCommandWorkingDirectory/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt index 5495a9b..2e12a78 100644 --- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt +++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt @@ -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}" ) -- cgit v0.12