summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-01-20 16:51:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-20 16:52:00 (GMT)
commit9b9dfacaa56240cabee28106237e1274d37fc460 (patch)
treea1050fd9cfb3477f739106813ac96dbbc982fc5b /Tests
parentac59da4c6a44527eaca5ea082a26488ea6c805c5 (diff)
parentba3a417dce45c6aa4f93d520ef0546b20f13fad9 (diff)
downloadCMake-9b9dfacaa56240cabee28106237e1274d37fc460.zip
CMake-9b9dfacaa56240cabee28106237e1274d37fc460.tar.gz
CMake-9b9dfacaa56240cabee28106237e1274d37fc460.tar.bz2
Merge topic 'acc-fix-in-source-depends-path'
ba3a417dce Tests/CustomCommand: add a test for depending on a `./path` e23475dc73 Tests/CustomCommand: fix custom command line to actually make its output db4780d584 cmGeneratorTarget: search for relative paths to the binary directory ec479f101f cmLocalGenerator: collapse the path after construction fd0ba705ce add_custom_command: check if a relative path should be an in-source path fd84f510f8 cmLocalGenerator: simplify the current source dir query Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4195
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CustomCommand/CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 70e8476..196fea3 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -535,6 +535,7 @@ 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}")
+# This also tests that `./` is squeezed out of the resulting path.
set(depends_path "./depended_upon_path.txt")
add_custom_command(
@@ -549,3 +550,19 @@ 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" depends_on_in_source_path.txt
+ DEPENDS main.cxx
+)
+
+add_custom_target(depends_on_in_source_path ALL DEPENDS "depends_on_in_source_path.txt")
+
+add_custom_command(
+ OUTPUT "depends_on_in_rel_source_path.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/main.cxx" depends_on_in_rel_source_path.txt
+ DEPENDS ./main.cxx
+)
+
+add_custom_target(depends_on_in_rel_source_path ALL DEPENDS "depends_on_in_rel_source_path.txt")