summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-05-31 11:20:30 (GMT)
committerCraig Scott <craig.scott@crascit.com>2024-05-31 12:55:20 (GMT)
commit7c516f7e28813a1ed66a4fd0a94d8a56b611eeef (patch)
tree04ae221bdaf7a1bd6d57da1aa7e96554efa11f3c /Tests/RunCMake/file
parent140766867b2c8f8dff0e4d0d73e481b6944b5284 (diff)
downloadCMake-7c516f7e28813a1ed66a4fd0a94d8a56b611eeef.zip
CMake-7c516f7e28813a1ed66a4fd0a94d8a56b611eeef.tar.gz
CMake-7c516f7e28813a1ed66a4fd0a94d8a56b611eeef.tar.bz2
file(): TOUCH, TOUCH_NOCREATE and MAKE_DIRECTORY accept empty lists
Projects may be generating a list of files or directories to pass as arguments to file(TOUCH), file(TOUCH_NOCREATE), or file(MAKE_DIRECTORY). Those lists might end up being empty, so rather than requiring at least one item, allow an empty list. Fixes: #24897
Diffstat (limited to 'Tests/RunCMake/file')
-rw-r--r--Tests/RunCMake/file/LOCK-error-no-path-stderr.txt2
-rw-r--r--Tests/RunCMake/file/TOUCH-result.txt1
-rw-r--r--Tests/RunCMake/file/TOUCH-stderr.txt9
-rw-r--r--Tests/RunCMake/file/TOUCH.cmake1
4 files changed, 2 insertions, 11 deletions
diff --git a/Tests/RunCMake/file/LOCK-error-no-path-stderr.txt b/Tests/RunCMake/file/LOCK-error-no-path-stderr.txt
index 2247aa6..6d70016 100644
--- a/Tests/RunCMake/file/LOCK-error-no-path-stderr.txt
+++ b/Tests/RunCMake/file/LOCK-error-no-path-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at LOCK-error-no-path.cmake:[0-9]+ \(file\):
- file must be called with at least two arguments.
+ sub-command LOCK requires at least two arguments\.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/file/TOUCH-result.txt b/Tests/RunCMake/file/TOUCH-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/file/TOUCH-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/file/TOUCH-stderr.txt b/Tests/RunCMake/file/TOUCH-stderr.txt
deleted file mode 100644
index 9f31676..0000000
--- a/Tests/RunCMake/file/TOUCH-stderr.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-^CMake Error at TOUCH\.cmake:[0-9]+ \(file\):
- file must be called with at least two arguments\.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at TOUCH\.cmake:[0-9]+ \(file\):
- file must be called with at least two arguments\.
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/file/TOUCH.cmake b/Tests/RunCMake/file/TOUCH.cmake
index 8931eb5..c92a962 100644
--- a/Tests/RunCMake/file/TOUCH.cmake
+++ b/Tests/RunCMake/file/TOUCH.cmake
@@ -12,5 +12,6 @@ if(NOT EXISTS "${file}")
endif()
file(REMOVE "${file}")
+# Empty arguments used to be an error, but this is valid since CMake 3.30
file(TOUCH)
file(TOUCH_NOCREATE)