summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-28 15:16:47 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-09-28 15:17:09 (GMT)
commitcac09cc52ccba9f3435e4d7cc227d15b6a009855 (patch)
tree5befeddbc7b7e6d94024b0e221c4528df335e4f7 /Tests
parent4e98203c6c318f7c2caf4c31b2c2863772eef57b (diff)
parentf158ac19e1e52362b04ff08c309ac3cf8e429bb7 (diff)
downloadCMake-cac09cc52ccba9f3435e4d7cc227d15b6a009855.zip
CMake-cac09cc52ccba9f3435e4d7cc227d15b6a009855.tar.gz
CMake-cac09cc52ccba9f3435e4d7cc227d15b6a009855.tar.bz2
Merge topic 'customcommandworkingdirectory'
f158ac19e1 add_custom_{command,target}: WORKING_DIRECTORY generator expressions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2409
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CustomCommandWorkingDirectory/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
index 4975feb..5495a9b 100644
--- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
+++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt
@@ -42,3 +42,23 @@ add_custom_target(
)
add_dependencies(working2 Custom2)
+
+file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/genex)
+add_custom_command(
+ OUTPUT "${TestWorkingDir_BINARY_DIR}/genex/working.c"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${TestWorkingDir_SOURCE_DIR}/working.c.in" "${TestWorkingDir_BINARY_DIR}/genex/working.c"
+ WORKING_DIRECTORY "${TestWorkingDir_BINARY_DIR}/$<1:genex>/"
+ COMMENT "custom command"
+)
+
+add_executable(workinggenex "${TestWorkingDir_BINARY_DIR}/genex/working.c"
+ "${TestWorkingDir_BINARY_DIR}/genex/customTarget.c")
+
+add_custom_target(
+ CustomGenex ALL
+ COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${TestWorkingDir_SOURCE_DIR}/customTarget.c" "${TestWorkingDir_BINARY_DIR}/genex/customTarget.c"
+ BYPRODUCTS "${TestWorkingDir_BINARY_DIR}/genex/customTarget.c"
+ WORKING_DIRECTORY "${TestWorkingDir_BINARY_DIR}/$<1:genex>/"
+)
+
+add_dependencies(workinggenex CustomGenex)