summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-12-18 14:48:40 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2019-12-18 18:57:07 (GMT)
commitf5126badd8aadd307a2d38b215cb1dc2ff43647d (patch)
tree74c74b828f39756f0f0ec7bc7e012a913160b699 /Tests
parenta5f44ec92558e229cf6927b321f5f7903af8b412 (diff)
downloadCMake-f5126badd8aadd307a2d38b215cb1dc2ff43647d.zip
CMake-f5126badd8aadd307a2d38b215cb1dc2ff43647d.tar.gz
CMake-f5126badd8aadd307a2d38b215cb1dc2ff43647d.tar.bz2
add_custom_command: convert DEPENDS path arguments to absolute paths
This is only done if they are "obviously" paths in that they contain a directory separator. Fixes: #17111
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CustomCommand/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index e4b50d0..70e8476 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -534,3 +534,18 @@ add_custom_command(
set_property(SOURCE "${gen_file}" PROPERTY SYMBOLIC ON)
add_custom_target(command_expand_lists ALL DEPENDS "${gen_file}")
set_property(TARGET command_expand_lists PROPERTY CMPARGS "${cmp_args}")
+
+set(depends_path "./depended_upon_path.txt")
+
+add_custom_command(
+ OUTPUT ${depends_path}
+ COMMAND ${CMAKE_COMMAND} -E touch ${depends_path}
+)
+
+add_custom_command(
+ OUTPUT "depends_on_path.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "depends_on_path.txt"
+ DEPENDS ${depends_path}
+)
+
+add_custom_target(depends_on_path ALL DEPENDS "depends_on_path.txt")