summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-07 19:41:29 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-07 19:41:29 (GMT)
commitf4acef500bb30563e1a6ec95cba0303adef71f79 (patch)
tree2800c8d50068174326457ea7e471250cdc55af54 /Tests
parentf7558c544707c81cc40c2b4ef1c3ac2063d3c692 (diff)
parentd26594f39073ce08eaa0ebab2f85d09c8673668c (diff)
downloadCMake-f4acef500bb30563e1a6ec95cba0303adef71f79.zip
CMake-f4acef500bb30563e1a6ec95cba0303adef71f79.tar.gz
CMake-f4acef500bb30563e1a6ec95cba0303adef71f79.tar.bz2
Merge topic 'ADDITIONAL_MAKE_CLEAN_FILES-genex'
d26594f Genex: Evaluate genexes for additional make clean files.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/MakeClean/ToClean/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt
index 28569dd..37d7292 100644
--- a/Tests/MakeClean/ToClean/CMakeLists.txt
+++ b/Tests/MakeClean/ToClean/CMakeLists.txt
@@ -26,6 +26,18 @@ add_custom_command(OUTPUT ${ToClean_BINARY_DIR}/generated.txt
add_custom_target(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt)
set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt")
+# Create a custom command whose output should be cleaned, but whose name
+# is not known until generate-time
+set(copied_exe "$<TARGET_FILE_DIR:toclean>/toclean_copy${CMAKE_EXECUTABLE_SUFFIX}")
+add_custom_command(TARGET toclean POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy $<TARGET_FILE:toclean>
+ ${copied_exe}
+ )
+set_property(DIRECTORY APPEND PROPERTY
+ ADDITIONAL_MAKE_CLEAN_FILES ${copied_exe})
+list(APPEND TOCLEAN_FILES "${ToClean_BINARY_DIR}/toclean_copy${CMAKE_EXECUTABLE_SUFFIX}")
+
# Configure a file listing these build-time-generated files.
configure_file(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in
${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE)