summaryrefslogtreecommitdiffstats
path: root/Tests/CustomCommand/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-27 15:57:17 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-28 14:06:21 (GMT)
commit9259d7788193ad23aa429652af983afc3bc4a953 (patch)
tree2d0755aa1fd32caf1071f6e1b78acf5dea60b59e /Tests/CustomCommand/CMakeLists.txt
parent57622bd19d3fd013038d34f497b106a7e2bfd26d (diff)
downloadCMake-9259d7788193ad23aa429652af983afc3bc4a953.zip
CMake-9259d7788193ad23aa429652af983afc3bc4a953.tar.gz
CMake-9259d7788193ad23aa429652af983afc3bc4a953.tar.bz2
Normalize OBJECT_DEPENDS paths to match custom commands (#15366)
Custom command path normalization added in commit v3.1.0-rc1~471^2 (add_custom_command: Normalize OUTPUT and DEPENDS paths, 2014-05-28) broke use of OBJECT_DEPENDS to bring in custom commands because the latter paths were not normalized too. Normalize them and add a test case. Reported-by: Daniel v. Gerpen
Diffstat (limited to 'Tests/CustomCommand/CMakeLists.txt')
-rw-r--r--Tests/CustomCommand/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index b97cd16..7ef3540 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -153,6 +153,19 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c
${PROJECT_BINARY_DIR}/foo.c
)
+# Test using OBJECT_DEPENDS to bring in a custom command.
+# Use a path that can be simplified to make sure paths
+# are consistently normalized.
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/subdir/subdir.h
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in
+ )
+set_property(SOURCE ${PROJECT_BINARY_DIR}/foo.c PROPERTY
+ OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h)
+
# Add custom command to generate not_included.h, which is a header
# file that is not included by any source in this project. This will
# test whether all custom command outputs explicitly listed as sources