diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2013-04-03 21:03:43 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2013-06-25 18:43:47 (GMT) |
commit | 88d27ad0140ac2274e886c10ac2bf9f8eede54c7 (patch) | |
tree | 552f9a5acf9820e1b22ad7f42ee05c37ef097a66 | |
parent | aecacd093b25001dcec0bdc5e612880fae6ee1e1 (diff) | |
download | CMake-88d27ad0140ac2274e886c10ac2bf9f8eede54c7.zip CMake-88d27ad0140ac2274e886c10ac2bf9f8eede54c7.tar.gz CMake-88d27ad0140ac2274e886c10ac2bf9f8eede54c7.tar.bz2 |
Add a test to expose a bug with add_custom_command and ninja.
Ninja Generator is unable to handle an add_custom_command having
a dependency that is generated at build time by a previous target.
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index d3ced3f..30daa7d 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -123,6 +123,19 @@ add_custom_command( COMMENT "Running TDocument post-build commands" ) +# Setup a custom target that will fail if the POST_BUILD custom command +# isn't run before it. +add_custom_command( + OUTPUT doc3post.txt + DEPENDS ${PROJECT_BINARY_DIR}/doc2post.txt + COMMAND ${CMAKE_COMMAND} -E echo " Copying doc2pre.txt to doc3post.txt." + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc2post.txt + ${PROJECT_BINARY_DIR}/doc3post.txt + COMMENT "Running TDocument post-build dependent custom command" + ) +add_custom_target(doc3Post ALL DEPENDS doc3post.txt) +add_dependencies(doc3Post TDocument) + ################################################################ # # Test using a multistep generated file |