summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/File_Generate/AdjacentInOut.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-07 17:53:20 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-08 19:49:56 (GMT)
commit4d40253f1cbb261aa469411a3c2a7ffc2ef761a4 (patch)
tree626d1ce3436dda57285381146b09728d8291f748 /Tests/RunCMake/File_Generate/AdjacentInOut.cmake
parenteaa420e99c86cb700f37fd21420ab86adeed798f (diff)
downloadCMake-4d40253f1cbb261aa469411a3c2a7ffc2ef761a4.zip
CMake-4d40253f1cbb261aa469411a3c2a7ffc2ef761a4.tar.gz
CMake-4d40253f1cbb261aa469411a3c2a7ffc2ef761a4.tar.bz2
Tests: Cover file(GENERATE) using 'foo.tmp' as input for output 'foo'
Fixes: #20873
Diffstat (limited to 'Tests/RunCMake/File_Generate/AdjacentInOut.cmake')
-rw-r--r--Tests/RunCMake/File_Generate/AdjacentInOut.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.cmake b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake
new file mode 100644
index 0000000..828c2ee
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0070 NEW)
+if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt")
+ message(FATAL_ERROR "CMake should not re-run during the build!")
+endif()
+configure_file(AdjacentInOut.in ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp)
+file(GENERATE OUTPUT AdjacentInOut.txt INPUT ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp)