summaryrefslogtreecommitdiffstats
path: root/Tests/MakeClean/ToClean
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-09 14:21:01 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-09 14:21:01 (GMT)
commit41b2216594093a2070c5eb7523c61fab7ff3f40e (patch)
tree9c8e302ed1446f73e9ba6fc170bc92004ec16dbf /Tests/MakeClean/ToClean
parentf6f765e86f88210025d8cec8be562835972ad102 (diff)
downloadCMake-41b2216594093a2070c5eb7523c61fab7ff3f40e.zip
CMake-41b2216594093a2070c5eb7523c61fab7ff3f40e.tar.gz
CMake-41b2216594093a2070c5eb7523c61fab7ff3f40e.tar.bz2
ENH: Adding test of "make clean".
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;
+}