Commit Graph

1281 Commits

Author SHA1 Message Date
Robert Maynard
c89d467bf2 Help: configure_file doc example use target_include_directories
Fixes #24351
2023-01-25 12:30:15 -05:00
Brad King
1d6d10cbf6 Merge topic 'isdir_empty'
a1dc38a567 Help: Document behavior of if(EXISTS,IS_DIRECTORY) for empty paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8109
2023-01-25 11:15:46 -05:00
scivision
a1dc38a567 Help: Document behavior of if(EXISTS,IS_DIRECTORY) for empty paths
Document and add explicit tests for empty string input:
`if(EXISTS "")` and `if(IS_DIRECTORY "")` are always false.
This avoids need for users to do extra checks due to
CMake non-short-circuit logic as below:

    if("${p}")
      if(EXISTS "${p}")
2023-01-24 14:13:52 -05:00
Robert Maynard
b787be2714 Help: Update supported languages in project and enable_language 2023-01-20 13:55:38 -05:00
Brad King
a78cba5197 message: Add CONFIGURE_LOG mode to record a message in the configure log
Provide a replacement for `file(APPEND .../CMake{Output,Error}.log)`
that records messages in the configure log.

Issue: #23200
2023-01-18 11:37:11 -05:00
Brad King
645671d36f Help: Document configure log behavior in try_compile and try_run 2023-01-18 11:37:02 -05:00
Brad King
d4bf7d80c6 try_compile: Add a NO_LOG option to skip recording in the configure log 2023-01-16 17:16:12 -05:00
Brad King
9d9e8450a8 try_compile: Add optional LOG_DESCRIPTION to record in configure log
Issue: #23200
2023-01-16 16:58:50 -05:00
Gustaf Borgström
b64a69b6c4 Help: Fix typo in configure_file docs 2023-01-11 16:32:35 -05:00
Craig Scott
c1294454e5 Merge topic 'doc-SYSTEM'
dfab263825 Help: Clarify and update SYSTEM-related docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8027
2022-12-19 15:57:22 -05:00
Marc Chevrier
d36754e163 Merge topic 'doc-updates'
22d36aa0f8 Help: string(JSON): avoid duplicate labels

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8028
2022-12-18 08:06:27 -05:00
Marc Chevrier
22d36aa0f8 Help: string(JSON): avoid duplicate labels 2022-12-17 12:42:36 +01:00
Craig Scott
dfab263825
Help: Clarify and update SYSTEM-related docs 2022-12-17 20:51:25 +11:00
Craig Scott
db6da7470a Merge topic 'doc-updates'
2ee845c0a5 Help: Add version information for SYSTEM option of add_subdirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8025
2022-12-17 04:50:00 -05:00
Marc Chevrier
2ee845c0a5 Help: Add version information for SYSTEM option of add_subdirectory 2022-12-16 14:05:43 +01:00
Marc Chevrier
7480fa0a5f COMPILE_DEFINITIONS property: ensure leading -D is removed in all cases
Fixes: #24186
2022-12-13 16:54:56 +01:00
Brad King
303c48fbd4 Help: Add add_custom_command example with output consumed by multiple targets
This is a common use case, so add an example demonstrating it.
2022-12-08 15:12:32 -05:00
Brad King
5f2bf6ecc6 Help: Drop misleading add_custom_command "makefile terms" explanation
The "In makefile terms" explanation is left from very early days of
CMake to help developers migrating from hand-written makefiles.
These days it is often misinterpreted, particularly in the context
of multiple `add_custom_command` calls, to mean that we generate a
single Makefile containing rules for all custom commands.  This
leads to an incorrect mental model of the expressed build system.
The actual generated build system may spread the rules across multiple
targets that do not see the each other's file-level rules, which makes
target-level dependencies important too.
2022-12-07 18:39:37 -05:00
Brad King
14824129d9 Merge topic 'doc-SYSTEM'
b15b9cf286 Help: Clarify SYSTEM property default for imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7990
2022-12-07 08:12:05 -05:00
Brad King
b15b9cf286 Help: Clarify SYSTEM property default for imported targets
The `SYSTEM` directory property does not affect imported targets.

Fixes: #24219
2022-12-05 19:42:06 -05:00
Craig Scott
512056158f Merge topic 'doc-add_compile_options-example'
f03a1833e2 Help: Update compiler-specific add_compile_options() example and prose

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7959
2022-11-29 06:35:55 -05:00
Michael Hirsch
f03a1833e2
Help: Update compiler-specific add_compile_options() example and prose
Avoid hard-coding a warning-as-error flag now that CMake offers a
first class abstraction for that.

Also mention some relevant generator expressions which can be used
to provide even more specific targeting with language-specific flags.

Fixes: #24200
2022-11-29 09:12:17 +11:00
Craig Scott
ab5aeca849
Help: Clarify behavior of BEFORE with target_compile_options() 2022-11-27 20:35:14 +11:00
Brad King
62172b4ab7 Merge topic 'custom-command-comment-genex'
26d813092b add_custom_{command,target}: add genex support for COMMENT
60a5a39022 cmCustomCommandGenerator: refactor GetComment to return std::string

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7887
2022-11-22 09:47:59 -05:00
Peter Würth
26d813092b add_custom_{command,target}: add genex support for COMMENT
Evaluate and expand generator expressions in the `COMMENT` argument of
the `add_custom_command()` and `add_custom_target()` commands.
This allows to include generator expressions, e.g. a targets location
$<TARGET_...> or the current configuration $<CONFIG>, in the build-time
messages.

Fixes #22507
2022-11-19 13:32:56 +01:00
Ben Boeckel
c36910476a Help: remove links from pages to themselves
At least the top-reference links. Internal `:ref:` usages have been left
intact.
2022-11-18 14:09:32 -05:00
Brad King
efa9eec040 file(COPY_FILE): Add option to retry on Windows if input access fails
On Windows, a file may be inaccessible for a short time after it is
created.  This occurs for various reasons, including indexing, antivirus
tools, and NTFS's asynchronous semantics.  Add an `INPUT_MAY_BE_RECENT`
option to tell CMake that the input file may have been recently created
so that we can retry a few times to read it.
2022-11-17 15:05:07 -05:00
Amir Masoud Abdol
ed519b1cba file(ARCHIVE_CREATE): Allow higher compression level for Zstd
This allows the Zstd compression-level to be set between 0-19.  I've
adjusted some of the tests, and error messages to indicates the selected
algorithm, and min/max of its compression-level.

Fixes: #24160
2022-11-16 09:15:01 -05:00
friendlyanon
59573bf5b9 project: Warn at top-level if cmake_minimum_required wasn't called
The top-level project() call will now issue an AUTHOR_WARNING if it
wasn't called after cmake_minimum_required().

Fixes: #24071
2022-11-11 22:49:36 +01:00
Brad King
e159b5b2ae Merge topic 'doc-improvements'
d4d1f85297 Help: Move a note about arguments and genexes into include file
968224484f Help: Drop unused `PROPERTY_GENEX` replace from `prop_tgt/INTERFACE_*` files
65457e4fae Help: Add _See Also_ sections to related CMake commands
c86ec79d07 Help: Use direct refs to genexes instead of ``$<GENEX-NAME>``
8c6274326d Help: Use CMake highlighting for command synopsis
c356a94512 Help: Use monospaced font for a genex name in a section title
f98c8707f4 Help: Use `code-block:: cmake` instead of `::` for sub-commands descriptions
2ba351ca4f Help: ``CMake`` → CMake
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7873
2022-11-10 10:11:22 -05:00
Alex Turbov
d4d1f85297
Help: Move a note about arguments and genexes into include file 2022-11-09 23:52:30 +04:00
Alex Turbov
65457e4fae
Help: Add _See Also_ sections to related CMake commands 2022-11-09 23:52:30 +04:00
Alex Turbov
c86ec79d07
Help: Use direct refs to genexes instead of `$<GENEX-NAME>` 2022-11-09 23:52:30 +04:00
Alex Turbov
8c6274326d
Help: Use CMake highlighting for command synopsis
Most of CMake commands use it. Fix a few of them to do the same.
2022-11-09 23:52:30 +04:00
Alex Turbov
c356a94512
Help: Use monospaced font for a genex name in a section title 2022-11-09 23:52:29 +04:00
Brad King
5b0b18bc35 Merge topic 'doc-block-return'
1046a61cfd Help: clean up and clarify block() and return()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7872
2022-11-08 09:01:24 -05:00
Brad King
09fb50a167 Merge topic 'doc-block-return' into release-3.25
1046a61cfd Help: clean up and clarify block() and return()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7872
2022-11-08 09:01:23 -05:00
Craig Scott
3c7707cf9d Merge topic 'doc-find-validator'
7e1a4567fb Help: Make VALIDATOR wording clearer and more precise

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7874
2022-11-08 06:42:29 -05:00
Alex Turbov
f98c8707f4
Help: Use code-block:: cmake instead of :: for sub-commands descriptions
Most of CMake commands use syntax highlighting when describe
sub-commands syntax. Fix a few of them to be like others...
2022-11-07 22:55:07 +04:00
Alex Turbov
cc8837606c
Help: Unindent _See Also_ related commands list
To make it similar to other commands.
2022-11-07 22:55:06 +04:00
Craig Scott
1046a61cfd
Help: clean up and clarify block() and return() 2022-11-08 00:05:55 +11:00
Craig Scott
7e1a4567fb
Help: Make VALIDATOR wording clearer and more precise 2022-11-07 23:51:51 +11:00
Alex Turbov
029210730a
Help: Use role :program:
When mention execitable names use Sphinx semantic role `:program`
instead of ``executable`` or **executable**.
2022-11-06 04:28:21 +04:00
Vasiliy Koyrev
9da542d5c1 string(TIMESTAMP): Add %z and %Z for adding time zone string
Fixes: #24056
2022-10-27 11:13:46 -04:00
Brad King
a0523f81d1 Merge topic 'doc-cli-xrefs'
3043c17039 Help: Add more CLI `:option:` references to various pages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7811
2022-10-21 10:19:54 -04:00
Brad King
63d28469cd Merge topic 'doc-cli-xrefs' into release-3.25
3043c17039 Help: Add more CLI `:option:` references to various pages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7811
2022-10-21 10:19:53 -04:00
Alex Turbov
3043c17039 Help: Add more CLI :option: references to various pages 2022-10-20 11:21:40 -04:00
Alex Turbov
65dc8aa8b3 Help: Mention CMake version for a recently-added find_package search path
Add a `versionadded` mark for the search path added by commit e55c154c5b
(cmFindPackageCommand: Add one more search path, 2022-06-27,
v3.25.0-rc1~339^2~1).

Fixes: #24067
2022-10-20 11:17:46 -04:00
Alex Turbov
93871cb5a9 Help: Reformat find_package search paths as Sphinx tables 2022-10-20 11:17:46 -04:00
Brad King
4cb8564087 Merge topic 'doc-timestamp-f' into release-3.25
7d25ae7350 Help: Add versionadded for string(TIMESTAMP) %f specifier

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7796
2022-10-17 10:00:57 -04:00