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
This commit is contained in:
Craig Scott
2024-05-31 21:20:30 +10:00
parent 140766867b
commit 7c516f7e28
7 changed files with 29 additions and 21 deletions
+8
View File
@@ -192,6 +192,10 @@ Writing
With ``TOUCH`` and ``TOUCH_NOCREATE``, the contents of an existing file
will not be modified.
.. versionchanged:: 3.30
``<files>`` can be an empty list. CMake 3.29 and earlier required
at least one file to be given.
.. signature::
file(GENERATE [...])
@@ -398,6 +402,10 @@ Filesystem
Create the given directories and their parents as needed.
.. versionchanged:: 3.30
``<directories>`` can be an empty list. CMake 3.29 and earlier required
at least one directory to be given.
.. signature::
file(REMOVE <files>...)
file(REMOVE_RECURSE <files>...)