Commit Graph

39 Commits

Author SHA1 Message Date
Marc Chevrier
e0412a0e0b Help: Fix spelling error in file(GET_RUNTIME_DEPENDENCIES) docs 2019-10-30 13:49:54 -04:00
Steve Mokris
c65f296960 Help: Mention file(GLOB)'s case-sensitivity
Based on the KWSYS_GLOB_CASE_INDEPENDENT flag in `Source/kwsys/Glob.cxx`.
2019-07-10 09:29:29 -04:00
Kyle Edwards
1f9ef25130 file: Add GET_RUNTIME_DEPENDENCIES mode
Co-Authored-by: Bryon Bean <bryon.bean@kitware.com>
2019-06-10 14:35:28 -04:00
Brad King
a1eb03569d file: Change REMOVE to ignore empty names
Previously code like

    file(REMOVE_RECURSE "${accidentally_missing_variable}")

treated the empty string as a relative path with respect to the
current directory and removed its contents.  Change this behavior
to ignore the empty string with a warning instead.

Normally such behavior changes are done with a policy, but in this case
such code is likely a real bug in project code that can delete data.

Fixes: #19274
2019-05-21 09:25:32 -04:00
Kyle Edwards
e3ff7ced63 file(INSTALL): Add FOLLOW_SYMLINK_CHAIN argument 2019-05-16 15:25:33 -04:00
Craig Scott
0f5a9f7934 Help: Clarify and improve readability of link-related file subcommands 2019-02-16 20:55:49 +11:00
Tushar Maheshwari
8bb7562f1a Help: Add documentation for file(CREATE_LINK) subcommand 2019-01-16 10:03:35 -05:00
Kyle Edwards
98a39be6cf file: Add READ_SYMLINK sub-command 2018-12-06 10:11:51 -05:00
Wouter Klouwen
12b471e828 file: add SIZE option
This commit adds the SIZE option to file(). It returns the file size of
the given path if it exists and produces an error if not.
2018-11-27 08:50:36 +00:00
Joachim Wuttke (l)
c2efb3efcd Help: Revise docs on Scripting Commands
Revise docs for all "Scripting Commands", except four find_XXX
that use a macro suite of their own.

* Take full advantage of the improved syntax highlighting.
* Make consequential use of <..> placeholders.
* Clarify things here and there in the text.

Specific improvements to some command docs:

* "math": Correct description of novel hexadecimal capability.
* "if", "foreach", "while": Provide link to "endif" etc
* "foreach", "while": Mention "break" and "continue".
* "foreach": Simplify explanation of ``RANGE`` and ``IN`` signatures;
   advise against negative arguments or reverse ranges (compare issue #18461)
* "endif", "endfunction" etc: Explain that the argument is optional and
   maintained for compatibility only
2018-10-23 15:12:10 +02:00
Brad King
08b4ea639c Help: Organize file command docs into sections
Add a synopsis section at the top summarizing all signatures.

Issue: #17948
2018-05-07 10:10:37 -04:00
Brad King
d5b2745b34 Help: Re-order file command docs
Prepare for the addition of section headers for grouping commands.
2018-05-07 10:10:37 -04:00
Shane Parris
6c4f8b4596 Adjust help documentation for file(GLOB), add topic notes 2018-04-01 23:16:13 -04:00
Shane Parris
602988e1e5 Adds file(TOUCH) and file(TOUCH_NOCREATE) sub-commands 2018-02-15 10:54:18 -05:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Shane Parris
5d67e9025d file(DOWNLOAD|UPLOAD): Add 'NETRC' and 'NETRC_FILE' suboption 2017-10-18 15:21:42 -04:00
Brad King
b745cb3e55 Merge topic 'file_WRITE_docs'
d7472bbf file: Clarify directory creation behavior when using WRITE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1088
2017-08-04 09:16:46 -04:00
Robert Dailey
d7472bbf16 file: Clarify directory creation behavior when using WRITE
When using `file(WRITE)`, parent directories are also created. Documentation
has been updated to explain this behavior.

Co-Author: Craig Scott <craig.scott@crascit.com>
2017-08-03 14:11:26 -04:00
Ruslan Baratov
75ca5f04df Help: Document that file(GLOB) result is sorted
It has been sorted since commit v3.6.0-rc1~54^2 (file: Sort GLOB results
to make it deterministic, 2016-05-14).  That commit left the order
unspecified in the documentation, but has been stable long enough to
document now.
2017-08-03 14:00:07 -04:00
Sylvain Joubert
c7d81e16cb Help: Explicitly state that some file generations are lazy
Fixes: #16856
2017-07-07 15:46:35 +02:00
Brad King
82be694c7a file(GENERATE): Add policy CMP0070 to define relative path behavior
Previously `file(GENERATE)` did not define any behavior for relative
paths given to the `OUTPUT` or `INPUT` arguments.  Define behavior
consistent with CMake conventions and add a policy to provide
compatibility for projects that relied on the old accidental behavior.

Fixes: #16786
2017-06-09 10:38:43 -04:00
Craig Scott
d039f7414f Help: Clarify file(GENERATE) only writes output file at generation phase
Closes: #16556
2017-04-10 09:58:22 -04:00
Brad King
979e8ba6c6 Help: De-duplicate and spell out supported hash algorithms
Spell out the supported algorithms in a definition list in the
`string(<HASH>)` command documentation.  Revise the `file(<HASH>)`
command and CPack module documentation to reference it instead of
duplicating the list.
2016-11-10 16:07:46 -05:00
Christian Fetzer
311d0376e2 Help: Document error behavior of file(REMOVE/REMOVE_RECURSE)
Clarifies that there is no need to surround file(REMOVE/REMOVE_RECURSE)
calls by `if(EXISTS)` as non existent files are silently ignored.
2016-11-01 10:25:18 +01:00
Ruslan Baratov
8f6cb36695 file(DOWNLOAD|UPLOAD): Add HTTPHEADER suboption 2016-09-15 21:41:39 +03:00
Ruslan Baratov
e5ba1041be file(DOWNLOAD|UPLOAD): Add 'USERPWD' suboption 2016-09-13 20:24:12 +03:00
Reiner Herrmann
edcccde7d6 file: Sort GLOB results to make it deterministic (#14491)
Even though the `file(GLOB)` documentation specifically warns against
using it to collect a list of source files, projects often do it anyway.
Since it uses `readdir()`, the list of files will be unsorted.
This list is often passed directly to add_executable / add_library.
Linking binaries with an unsorted list will make it unreproducible,
which means that the produced binary will differ depending on the
unpredictable `readdir()` order.

To solve those reproducibility issues in a lot of programs (which don't
explicitly `list(SORT)` the list manually), sort the resulting list of
the `file(GLOB)` command.

A more detailed rationale about reproducible builds is available
[here](https://reproducible-builds.org/).
2016-05-17 10:12:11 -04:00
Ruslan Baratov
5a208f834e Help: Document that file(GLOB*) order is undefined
Since this command use 'readdir' under the hood the order of list is
undefined:
* http://stackoverflow.com/questions/8977441/does-readdir-guarantee-an-order
2015-10-21 08:51:54 -04:00
Brad King
f39d26caa7 Help: Clarify file(COPY) directory semantics (#15561)
State explicitly that directory structure is preserved.
2015-05-08 09:29:05 -04:00
Domen Vrankar
a2c068a7ce file: Teach GLOB to list directories optionally
GLOB lists directories by default and GLOB_RECURSE does not.
LIST_DIRECTORIES enables user to control the behavior explicitly for
consistently for both GLOB and GLOB_RECURSE.
2015-03-20 09:45:25 -04:00
Justin Borodinsky
1f77a7001b file: Teach STRINGS to support UTF-16 and UTF-32 encodings 2015-01-27 11:30:26 -05:00
Brad King
03db9a061a Merge topic 'doc-file-GENERATE-order'
fe21580b Help: Document file(GENERATE) signature option order
2014-12-05 14:01:04 -05:00
Brad King
fe21580b84 Help: Document file(GENERATE) signature option order
In commit v3.1.0-rc1~484^2 (Help: Format and revise file() command
documentation, 2014-05-23) the signature of file(GENERATE) was
accidentally simplified too much and dropped specification of the
required argument ordering.  Restore the signature to make the order
clear.
2014-12-05 13:28:24 -05:00
Ruslan Baratov
e6db4c5a4e file: Add LOCK subcommand to do file and directory locking
Provide options to fail without blocking or to block up to a timeout.
Provide options to specify the scope containing the lock so it can be
released automatically at the end of a function, file, or process.

Extend the RunCMake.file test with cases covering the file(LOCK) command
usage and error cases.
2014-12-03 09:47:44 -05:00
Clinton Stimpson
5b30ec28f9 file: Add ENCODING option to file(STRINGS) command (#10519)
Support extraction of UTF-8 strings.
2014-08-06 09:23:47 -04:00
Brad King
c9568de52c install: Add CMAKE_INSTALL_MESSAGE variable (#13761)
Create a variable to allow users to control which installation
messages are printed.  In particular, provide a "LAZY" setting
that prints "Installing" messages but not "Up-to-date" messages.
This is desirable for incremental re-installations.

Suggested-by: J Decker <d3ck0r@gmail.com>
2014-06-24 13:18:20 -04:00
Stephen Kelly
5fb9b16d0c Help: Document that file(GENERATE) re-writes only when needed. 2014-06-05 11:58:02 +02:00
Brad King
d74ed5431a Help: Format and revise file() command documentation
Organize the documentation by sub-command to keep the signatures and
their descriptions nearby.  Use inline and explicit reST markup.  Revise
wording as necessary for the updated layout.  Clarify behavior of the
file(GENERATE) command w.r.t. conflicting file names.
2014-05-23 16:16:47 -04:00
Kitware Robot
f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00