summaryrefslogtreecommitdiffstats
path: root/Tests/MakeClean/ToClean
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/MakeClean/ToClean')
-rw-r--r--Tests/MakeClean/ToClean/CMakeLists.txt22
-rw-r--r--Tests/MakeClean/ToClean/ToCleanFiles.cmake.in1
-rw-r--r--Tests/MakeClean/ToClean/toclean.cxx4
3 files changed, 27 insertions, 0 deletions
diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt
new file mode 100644
index 0000000..49507f4
--- /dev/null
+++ b/Tests/MakeClean/ToClean/CMakeLists.txt
@@ -0,0 +1,22 @@
+PROJECT(ToClean)
+
+# Build a simple project.
+ADD_EXECUTABLE(toclean toclean.cxx)
+
+# List some build-time-generated files.
+GET_TARGET_PROPERTY(TOCLEAN_FILES toclean LOCATION)
+SET(TOCLEAN_FILES ${TOCLEAN_FILES}
+ "${ToClean_BINARY_DIR}/toclean${CMAKE_CXX_OUTPUT_EXTENSION}")
+#SET(TOCLEAN_FILES ${TOCLEAN_FILES}
+# "${ToClean_BINARY_DIR}/toclean.dir/toclean${CMAKE_CXX_OUTPUT_EXTENSION}")
+
+# Create a file that must be registered for cleaning.
+FILE(WRITE "${ToClean_BINARY_DIR}/Registered.txt"
+ "File registered for cleaning.\n")
+SET_DIRECTORY_PROPERTIES(PROPERTIES
+ ADDITIONAL_MAKE_CLEAN_FILES "${ToClean_BINARY_DIR}/Registered.txt")
+SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt")
+
+# Configure a file listing these build-time-generated files.
+CONFIGURE_FILE(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in
+ ${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE)
diff --git a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
new file mode 100644
index 0000000..10d11c3
--- /dev/null
+++ b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in
@@ -0,0 +1 @@
+SET(TOCLEAN_FILES "@TOCLEAN_FILES@")
diff --git a/Tests/MakeClean/ToClean/toclean.cxx b/Tests/MakeClean/ToClean/toclean.cxx
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/MakeClean/ToClean/toclean.cxx
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}