summaryrefslogtreecommitdiffstats
path: root/Tests/CustomCommand
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2020-01-09 15:14:38 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-01-16 18:54:26 (GMT)
commitfd0ba705ce37f54eb88f17e257e5a57e823351bb (patch)
treedea7eabac44a62c27cdec775195bcda2859f9abb /Tests/CustomCommand
parentfd84f510f8f22244853115782af58cad5884934b (diff)
downloadCMake-fd0ba705ce37f54eb88f17e257e5a57e823351bb.zip
CMake-fd0ba705ce37f54eb88f17e257e5a57e823351bb.tar.gz
CMake-fd0ba705ce37f54eb88f17e257e5a57e823351bb.tar.bz2
add_custom_command: check if a relative path should be an in-source path
This still is broken for dependencies on generated paths where they get generated to the source directory rather than the build directory however, but there's no way to determine that is the case. Fixes: #20194
Diffstat (limited to 'Tests/CustomCommand')
-rw-r--r--Tests/CustomCommand/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 70e8476..86c74ba 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -549,3 +549,11 @@ add_custom_command(
)
add_custom_target(depends_on_path ALL DEPENDS "depends_on_path.txt")
+
+add_custom_command(
+ OUTPUT "depends_on_in_source_path.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/main.cxx" in_source_path.txt
+ DEPENDS main.cxx
+)
+
+add_custom_target(depends_on_in_source_path ALL DEPENDS "depends_on_in_source_path.txt")