diff options
author | Brad King <brad.king@kitware.com> | 2008-08-05 17:27:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-08-05 17:27:14 (GMT) |
commit | 32df2a715b974ebd8c5a6224b08f082920759a8b (patch) | |
tree | 48da1181e5e920beec4d07d4c9be854d2071348e /Tests/CustomCommand | |
parent | 7e11c5e92857de06f842e1753f32afd024ab40ca (diff) | |
download | CMake-32df2a715b974ebd8c5a6224b08f082920759a8b.zip CMake-32df2a715b974ebd8c5a6224b08f082920759a8b.tar.gz CMake-32df2a715b974ebd8c5a6224b08f082920759a8b.tar.bz2 |
ENH: Test relative path custom command output
As of CMake 2.6 a custom command output specified by relative path is
placed in the build tree. This adds a test to make sure other
references to the output are hooked up correctly, fixing a bug in CMake
2.6.1.
Diffstat (limited to 'Tests/CustomCommand')
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 5d785bc..b8410e1 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -83,12 +83,22 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h # Add the location of foo.h to the include path. INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) +# Test generation of a file to the build tree without full path. As +# of CMake 2.6 custom command outputs specified by relative path go in +# the build tree. +ADD_CUSTOM_COMMAND( + OUTPUT doc1.txt + COMMAND ${CMAKE_COMMAND} -E echo "Example Document Target" > doc1.txt + DEPENDS doc1.tex + VERBATIM + ) + # Add a custom target to drive generation of doc1.h. ADD_CUSTOM_TARGET(TDocument ALL COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.h to doc2.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.h ${PROJECT_BINARY_DIR}/doc2.h - DEPENDS ${PROJECT_BINARY_DIR}/doc1.h + DEPENDS ${PROJECT_BINARY_DIR}/doc1.h doc1.txt COMMENT "Running top-level TDocument commands" ) |