summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-02-22 19:31:12 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-02-22 19:31:12 (GMT)
commit542f45f4521ed4702c948a8750e2789b07017d48 (patch)
tree971dc423be23488cf49a525336388310e0f22431 /Tests
parent45efcc8fa6eff6447402c9314953404d85d2a2c8 (diff)
parent88548a45fbd35205469ac9fd332349551e172496 (diff)
downloadCMake-542f45f4521ed4702c948a8750e2789b07017d48.zip
CMake-542f45f4521ed4702c948a8750e2789b07017d48.tar.gz
CMake-542f45f4521ed4702c948a8750e2789b07017d48.tar.bz2
Merge topic 'custom-command-slashes'
88548a4 Handle relative WORKING_DIRECTORY in add_custom_(command|target) 7befc00 Handle trailing slashes on add_custom_command DEPENDS
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CustomCommandWorkingDirectory/CMakeLists.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
index 57cb712..36d32e4 100644
--- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
+++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
@@ -9,8 +9,8 @@ ADD_CUSTOM_COMMAND(
)
SET_SOURCE_FILES_PROPERTIES(
- "${TestWorkingDir_BINARY_DIR}/working.c"
- "${TestWorkingDir_BINARY_DIR}/customTarget.c"
+ "${TestWorkingDir_BINARY_DIR}/customTarget.c"
+ "${TestWorkingDir_BINARY_DIR}/customTarget2.c"
PROPERTIES GENERATED 1)
ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c"
@@ -23,3 +23,20 @@ ADD_CUSTOM_TARGET(
)
ADD_DEPENDENCIES(working Custom)
+
+file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work)
+add_custom_command(
+ OUTPUT working2.c # Relative to build tree
+ COMMAND "${CMAKE_COMMAND}" -E copy ${TestWorkingDir_SOURCE_DIR}/working.c.in ../working2.c
+ DEPENDS ${TestWorkingDir_SOURCE_DIR}/working.c.in/ # trailing slash should be removed
+ WORKING_DIRECTORY work/ # Relative to build tree, trailing slash
+ )
+add_executable(working2 working2.c ${TestWorkingDir_BINARY_DIR}/customTarget2.c)
+
+add_custom_target(
+ Custom2 ALL
+ COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${TestWorkingDir_SOURCE_DIR}/customTarget.c ../customTarget2.c
+ WORKING_DIRECTORY work/ # Relative to build tree, trailing slash
+)
+
+add_dependencies(working2 Custom2)