mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-17 07:11:52 +08:00
Adjust help documentation for file(GLOB), add topic notes
This commit is contained in:
@@ -98,10 +98,10 @@ command.
|
|||||||
::
|
::
|
||||||
|
|
||||||
file(GLOB <variable>
|
file(GLOB <variable>
|
||||||
[LIST_DIRECTORIES true|false] [RELATIVE <path>]
|
[LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
|
||||||
[<globbing-expressions>...])
|
[<globbing-expressions>...])
|
||||||
file(GLOB_RECURSE <variable> [FOLLOW_SYMLINKS]
|
file(GLOB_RECURSE <variable> [FOLLOW_SYMLINKS]
|
||||||
[LIST_DIRECTORIES true|false] [RELATIVE <path>]
|
[LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
|
||||||
[<globbing-expressions>...])
|
[<globbing-expressions>...])
|
||||||
|
|
||||||
Generate a list of files that match the ``<globbing-expressions>`` and
|
Generate a list of files that match the ``<globbing-expressions>`` and
|
||||||
@@ -110,6 +110,11 @@ regular expressions, but much simpler. If ``RELATIVE`` flag is
|
|||||||
specified, the results will be returned as relative paths to the given
|
specified, the results will be returned as relative paths to the given
|
||||||
path. The results will be ordered lexicographically.
|
path. The results will be ordered lexicographically.
|
||||||
|
|
||||||
|
If the ``CONFIGURE_DEPENDS`` flag is specified, CMake will add logic
|
||||||
|
to the main build system check target to rerun the flagged ``GLOB`` commands
|
||||||
|
at build time. If any of the outputs change, CMake will regenerate the build
|
||||||
|
system.
|
||||||
|
|
||||||
By default ``GLOB`` lists directories - directories are omitted in result if
|
By default ``GLOB`` lists directories - directories are omitted in result if
|
||||||
``LIST_DIRECTORIES`` is set to false.
|
``LIST_DIRECTORIES`` is set to false.
|
||||||
|
|
||||||
@@ -118,6 +123,10 @@ By default ``GLOB`` lists directories - directories are omitted in result if
|
|||||||
your source tree. If no CMakeLists.txt file changes when a source is
|
your source tree. If no CMakeLists.txt file changes when a source is
|
||||||
added or removed then the generated build system cannot know when to
|
added or removed then the generated build system cannot know when to
|
||||||
ask CMake to regenerate.
|
ask CMake to regenerate.
|
||||||
|
The ``CONFIGURE_DEPENDS`` flag may not work reliably on all generators, or if
|
||||||
|
a new generator is added in the future that cannot support it, projects using
|
||||||
|
it will be stuck. Even if ``CONFIGURE_DEPENDS`` works reliably, there is
|
||||||
|
still a cost to perform the check on every rebuild.
|
||||||
|
|
||||||
Examples of globbing expressions include::
|
Examples of globbing expressions include::
|
||||||
|
|
||||||
|
6
Help/release/dev/glob_configure_depends.rst
Normal file
6
Help/release/dev/glob_configure_depends.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
glob_configure_depends
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
* The :command:`file(GLOB)` and :command:`file(GLOB_RECURSE)` commands
|
||||||
|
learned a new flag ``CONFIGURE_DEPENDS`` which enables expression of
|
||||||
|
build system dependency on globbed directory's contents.
|
Reference in New Issue
Block a user