diff options
author | Pedro Navarro <pnavarro@netflix.com> | 2018-09-27 23:57:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-28 15:28:36 (GMT) |
commit | 9c2b393cb7750cf182e765f679f9876851aa5055 (patch) | |
tree | 7f306785225e11e4f257d84e7a1ebf691aaa4bb7 /Tests/CustomCommandWorkingDirectory | |
parent | cac09cc52ccba9f3435e4d7cc227d15b6a009855 (diff) | |
download | CMake-9c2b393cb7750cf182e765f679f9876851aa5055.zip CMake-9c2b393cb7750cf182e765f679f9876851aa5055.tar.gz CMake-9c2b393cb7750cf182e765f679f9876851aa5055.tar.bz2 |
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.
Diffstat (limited to 'Tests/CustomCommandWorkingDirectory')
-rw-r--r-- | Tests/CustomCommandWorkingDirectory/CMakeLists.txt | 8 |
1 files 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}" ) |