Commit Graph

1473 Commits

Author SHA1 Message Date
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
Brad King
7d25ae7350 Help: Add versionadded for string(TIMESTAMP) %f specifier
This was accidentally left out of commit c050d6a01e (string(TIMESTAMP):
add %f specifier for microseconds, 2022-01-27, v3.23.0-rc1~59^2).
2022-10-14 11:28:38 -04:00
Brad King
f9fd27a5ee Help: Fix typo that crashes older pygments lexers
In commit cb14ae2b87 (try_compile: Add SOURCE_FROM_{ARG,VAR},
2022-09-21, v3.25.0-rc1~94^2~2) we accidentally added unbalanced closing
`]` characters in the `try_compile` and `try_run` signatures.

Fixes: #24053
2022-10-13 12:04:00 -04:00
Craig Scott
f8b3b24915
Help: Minor grammar, typo and formatting cleanups 2022-10-09 13:34:05 +11:00
Brad King
b768a5e23b Help: Disambiguate cmake(1) program modes in Sphinx option references
Define the entry point to each mode as an option for the `cmake`
program, but reference the options for that mode as part of stand-in
`cmake-<mode>` programs.
2022-10-05 15:27:40 -04:00
Brad King
5e53164acf Merge topic 'improve-try_compile-debug-documentation'
3801785cc3 Help: Improve try_compile debug documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: alcroito <alexandru.croitor@qt.io>
Merge-request: !7735
2022-10-04 10:28:32 -04:00
Brad King
6755539fca Merge topic 'fix-try_compile-doc-typo'
ef05a56387 Help: Fix typo in try_compile documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7736
2022-10-04 10:27:40 -04:00
Matthew Woehlke
3801785cc3 Help: Improve try_compile debug documentation
Update the --debug-trycompile documentation to account for recent
changes to try_compile. Mention where in the build tree to find
artifacts when using said option.
2022-10-03 11:44:58 -04:00
Matthew Woehlke
ef05a56387 Help: Fix typo in try_compile documentation 2022-09-30 15:49:35 -04:00
Matthew Woehlke
0f28653ba9 try_compile: Rename SOURCE_FROM_ARG -> SOURCE_FROM_CONTENT
Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT
(which we can do because it was recently added and hasn't been in a
release yet). The new name should be clearer as to what it does, and
also more consistent with the CONTENT arguments to some other commands.

Also, fix a typo in an error message.
2022-09-30 14:50:25 -04:00
Matthew Woehlke
09b3051524 try_compile: Add NO_CACHE option (also try_run)
Add NO_CACHE option to try_compile and try_run, which places the results
in regular, rather than cache, variables.

Issue: #22799
2022-09-28 13:41:11 -04:00
Brad King
164a156c7c Merge topic 'remove-vs10-generator'
8d6f015d59 Drop Visual Studio 10 2010 generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7718
2022-09-27 10:32:11 -04:00
Brad King
50b668ddc8 Merge topic 'add_subdirectory_system'
2eb30a7036 add_subdirectory: Add SYSTEM option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7399
2022-09-27 10:28:49 -04:00
Brad King
8d6f015d59 Drop Visual Studio 10 2010 generator
This generator has been deprecated since CMake 3.22.  Remove it.
2022-09-26 15:43:04 -04:00
Da Quexian
2eb30a7036 add_subdirectory: Add SYSTEM option
Fixes: #22401
Signed-off-by: Da Quexian <daquexian566@gmail.com>
2022-09-26 10:56:54 -04:00
Brad King
98aef0929f Merge topic 'try_compile-source-from'
611d801790 try_compile: Add SOURCE_FROM_FILE
a04eaf6742 Tests: Clean up and simplify TryCompile tests
cb14ae2b87 try_compile: Add SOURCE_FROM_{ARG,VAR}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7700
2022-09-23 08:52:13 -04:00
Matthew Woehlke
611d801790 try_compile: Add SOURCE_FROM_FILE
Add ability to copy try_compile (and try_run) source files from
arbitrary locations into the operation directory. This is included for
the sake of completion and consolidation, although use cases which
actually require this may be rare.
2022-09-22 14:56:50 -04:00
Matthew Woehlke
cb14ae2b87 try_compile: Add SOURCE_FROM_{ARG,VAR}
Add ability to "feed" try_compile (and try_run) sources more directly,
either from literal content, or from a CMake variable which contains
literal content. This saves the user from needing a separate step to
write the content to a file, and allows for the sources to only exist in
the scratch directory.
2022-09-22 13:33:27 -04:00
Hinell
37381506dc Help: Link from add_custom_target to policy on BYPRODUCTS
Link policy explaining BYPRODUCTS.

Apply the change from commit 00b788e85e (Help:custom_command: link
policy on BYPRODUCTS, 2022-09-09) to `add_custom_target` docs too.

Issue: #23786
2022-09-19 12:39:29 -04:00
Brad King
71cfcbe816 Merge topic 'transitive-usage-reqs-lnks'
3d31f99b74 Help: Link from usage requirement commands to detailed explanation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7653
2022-09-19 10:24:15 -04:00
Brad King
e9d9cd348c Merge topic 'help-add-custom-comman-byproducts'
00b788e85e Help:custom_command: link policy on BYPRODUCTS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7662
2022-09-19 10:23:02 -04:00
Hinell
3d31f99b74 Help: Link from usage requirement commands to detailed explanation
Augment vague mentions of "Transitive Usage Requirements" with links to
a detailed explanation.

Fixes: #23799
2022-09-16 10:54:27 -04:00
Hinell
00b788e85e Help:custom_command: link policy on BYPRODUCTS
Link policy explaining BYPRODUCTS.

Fixes: #23786
2022-09-16 10:50:46 -04:00
Matthew Woehlke
56ae40cc59 try_compile: Add PROJECT keyword-dispatched signature
Introduce a new signature for the project flavor of try_compile (and
try_run) which removes the `bindir` argument and adds a required PROJECT
tag. This is similar to the SOURCES flavor added by commit aa9220d3
(try_compile: Add keyword-dispatched signature, 2022-09-02).
2022-09-14 16:35:50 -04:00
Glen Chung
0e96a20478 MSVC: Add abstraction for debug information format
Replace our hard-coded default for `/Zi` with a first-class abstraction
to select the debug information format an enumeration of logical
names.  We've long hesitated to do this because the idea of "debug
information format" touches on related concepts on several platforms.
Avoid that scope creep by simply defining an abstraction that applies
only when targeting the MSVC ABI on Windows.

Removing the old default flag requires a policy because existing
projects may rely on string processing to edit them and choose a
runtime library under the old behavior.  Add policy CMP0141 to
provide compatibility.

Fixes: #10189
2022-09-14 09:12:47 -04:00
Brad King
ecfc63a9b0 Merge topic 'try_compile-unique-bindir'
aa9220d3a0 try_compile: Add keyword-dispatched signature
d1befe5515 cmSystemTools: Add MakeTempDirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Matthew Woehlke <matthew.woehlke@kitware.com>
Merge-request: !7579
2022-09-07 10:43:14 -04:00
Matthew Woehlke
aa9220d3a0 try_compile: Add keyword-dispatched signature
Introduce a new signature for try_compile (and try_run) which removes
the `bindir` argument and requires the SOURCES tag. This will eventually
allow us to add other ways of providing sources, but also allows us to
change the behavior without breaking compatibility.

The old signature uses a special, but non-unique temporary location
inside the specified `bindir`, which conventionally is just the
project's build directory. The new signature unconditionally uses the a
unique temporary directory which is unconditionally within the project's
build directory (which is no longer separately specified). This ensures
that successive runs do not overwrite previous runs, will simplify
debugging, and should also, eventually, allow us to execute multiple
trials in parallel.
2022-09-05 13:19:59 -04:00
Marc Chevrier
838a5fae23 return(): Propagate variables to result scope
Fixes: #23871
2022-09-03 23:10:01 +02:00
Brad King
b9371c0477 Merge topic 'CMAKE_FIND_USE_INSTALL_PREFIX-support-staging-prefix'
0fc10bb19b CMAKE_FIND_USE_INSTALL_PREFIX considers CMAKE_STAGING_PREFIX
43d31c5198 cmFindBase: Refactor CMAKE_FIND_USE_INSTALL_PREFIX handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7623
2022-08-31 09:39:52 -04:00
Brad King
aa7316a358 Merge topic 'doc-CMP0134-fixes'
7dca3807f8 Help: Fix typos, grammar and formatting in CMP0134 policy docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7620
2022-08-31 09:37:46 -04:00
Robert Maynard
0fc10bb19b CMAKE_FIND_USE_INSTALL_PREFIX considers CMAKE_STAGING_PREFIX
Fixes #23900
2022-08-30 17:52:40 -04:00
Craig Scott
7dca3807f8 Help: Fix typos, grammar and formatting in CMP0134 policy docs 2022-08-30 15:11:09 -04:00
Craig Scott
bbda95e7bd Merge topic 'file-DOWNLOAD-existing-file-matched-message'
666b3c6f13 Help: Clarify file(DOWNLOAD) behavior for existing file with same hash
87a40b720a file(DOWNLOAD): Fix message for existing file with matching hash

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7599
2022-08-26 06:53:46 -04:00
Michael Hirsch
666b3c6f13
Help: Clarify file(DOWNLOAD) behavior for existing file with same hash 2022-08-23 22:42:06 +10:00
Marc Chevrier
44a2f3f332 Add new flow-control commands for variables and policies scopes management
Add block() and endblock() commands offering the capability to create
new scopes for variables and/or policies.

Fixes: #20171
2022-08-22 16:25:53 +02:00
Craig Scott
fadc93286a
Help: Add crossrefs to ctest output control options 2022-08-19 14:47:01 +10:00
Craig Scott
de892f3d4e
Help: Add crossrefs to ctest output control options 2022-08-19 14:45:36 +10:00
Craig Scott
3453e6bd48
Merge branch 'backport-3.24-doc-ctest_test-output-control' into doc-ctest_test-output-control 2022-08-19 14:30:50 +10:00
Craig Scott
8981e88b18
Help: Add missing closing quote on C++ example 2022-08-19 14:03:18 +10:00
Brad King
5d76ff6019 Help: Fix formatting of CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API notes 2022-08-09 13:05:34 -04:00
Brad King
ed86192cd8 Merge topic 'doc-markup-program-options'
a6abdf6c8f Help: Consistent options declaration -- short first, then long
f4563f05db Help: Value for `--graphviz=` option actually is mandatory
04843d743e Help: Replace a bunch of more ``--option`` to `:option:` role
09446266ee Help: Replace mentions of ``-D`` option with :option:`-D` role
b57f27b087 Help: Replace mentions of ``-T`` and ``-A`` options with role
d25b232dee Help: Replace mentions of ``-G`` option with :option:`-G` role
63940e1cab Help: Replace mentions of ``-C`` option with :option:`-C` role
183a49cbfe Help: Replace mentions of ``-S`` option with :option:`-S` role
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7544
2022-08-08 09:39:41 -04:00
Brad King
9274bdff27 Merge topic 'find_package-one-more-path'
19366408fe cmFindPackageCommand: Protect overrides of `cmDirectoryListGenerator`
e55c154c5b cmFindPackageCommand: Add one more search path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7542
2022-08-05 08:53:09 -04:00
Alex Turbov
04843d743e Help: Replace a bunch of more `--option to :option:` role 2022-08-04 19:34:45 +04:00
Alex Turbov
183a49cbfe Help: Replace mentions of `-S option with :option:-S` role 2022-08-04 19:33:42 +04:00
Alex Turbov
e55c154c5b cmFindPackageCommand: Add one more search path
The `PREFIX/(Foo|foo|FOO).*/(cmake|CMake)/(Foo|foo|FOO).*/` search
path is the similar to the one already exists
`PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib*|share)/cmake/(Foo|foo|FOO).*/`.
2022-08-04 09:41:59 -04:00
Brad King
2ed7d6cee7 Merge topic 'doc-find_package-typo'
5635d33656 Help: Fix reST syntax typo in find_package docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7540
2022-08-04 09:33:50 -04:00
Eisuke Kawashima
5635d33656 Help: Fix reST syntax typo in find_package docs 2022-08-03 10:02:21 -04:00
Brad King
41597025f9 Merge topic 'doc-if-PATH_EQUAL'
37e01773e4 Help: Clarify behavior of path-based equality conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7503
2022-07-26 09:22:29 -04:00
Brad King
d4336c9c99 Merge topic 'doc-if-PATH_EQUAL' into release-3.24
37e01773e4 Help: Clarify behavior of path-based equality conditions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7503
2022-07-26 09:22:28 -04:00
Brad King
1cde77e526 Merge topic 'doc-find_package-BYPASS_PROVIDER'
4f7a0c25d2 Help: Document BYPASS_PROVIDER keyword for find_package()
76370e06b8 Help: Minor grammar fix for the Using Dependencies manual

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7501
2022-07-25 12:02:20 -04:00
Craig Scott
37e01773e4 Help: Clarify behavior of path-based equality conditions
The docs for if(PATH_EQUAL) did not mention the component-wise
nature of the checks. It also claimed no normalization was
performed, but multiple separators are effectively collapsed
(part of normalization). Improve the wording to clarify both of
these points.

Also update the corresponding description of cmake_path(COMPARE),
which had the same inaccuracy.

Fixes: #23758
2022-07-24 16:03:20 +10:00
Craig Scott
4f7a0c25d2 Help: Document BYPASS_PROVIDER keyword for find_package()
Fixes: #23669
2022-07-23 21:43:49 +10:00
Brad King
66998035c1 Merge topic 'try_run_split_output'
a2cd0687db try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7453
2022-07-22 10:14:34 -04:00
Brad King
4ea33b41d7 Merge topic 'doc-execute_process'
70c26a65b7 Help: Clarify execute_process OS-specific command-line encoding

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7492
2022-07-20 12:39:44 -04:00
Brad King
70c26a65b7 Help: Clarify execute_process OS-specific command-line encoding
Issue: #23557
2022-07-20 11:46:23 -04:00
Brad King
12192e7f94 Merge topic 'doc_command_links'
033c066543 Help: Add see-also refs for flow control commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7467
2022-07-20 09:27:55 -04:00
Brad King
e077d0b351 Merge topic 'doc-example-target-sources'
c7c5a50b97 Help: Add missing PRIVATE keyword to target_sources() example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7490
2022-07-20 08:45:54 -04:00
Craig Scott
c7c5a50b97 Help: Add missing PRIVATE keyword to target_sources() example
Fixes: #23746
2022-07-20 20:19:37 +10:00
Markus Ferrell
033c066543 Help: Add see-also refs for flow control commands 2022-07-19 13:06:25 -04:00
Patrick Northon
a2cd0687db try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE. 2022-07-08 15:49:02 -04:00
Brad King
983a5b1a7e Merge topic 'install-destination-docs'
52164be691 Help: Clarify behavior of install(TARGETS) for DLLs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7457
2022-07-08 09:05:51 -04:00
Kyle Edwards
52164be691 Help: Clarify behavior of install(TARGETS) for DLLs
Fixes: #23695
2022-07-06 12:03:53 -04:00
Ben Boeckel
fe44cbe9e7 exports: support CXX_MODULES_DIRECTORY
This directory will be used to store build-discovered information about
targets such as the modules provided by the files in the relevant
`FILE_SET` types.

A directory is used because basing the name on a `<FILE_NAME>-*.cmake`
pattern makes it end up being globbed in the configuration-dependent
information mechanism. Since old modules and targets may be around,
unconditionally including them may refer to targets that do not actually
exist.
2022-07-06 10:15:23 -04:00
Ben Boeckel
29118091dc install: support CXX_MODULES_BMI installation bits 2022-07-06 10:15:23 -04:00
Ben Boeckel
f3cfde394a cmTargetSourcesCommand: allow INTERFACE C++ modules when imported
`PUBLIC` filesets become `INTERFACE` upon installation. Allow
`INTERFACE` scopes for C++ modules when the target is imported.
2022-07-06 10:15:23 -04:00
Brad King
b80ccea686 Merge topic 'enable_language-deduplicate'
e3c8012ccd Help: Document enable_language accepting multiple languages
b4fd385c9b cmMakefile: Dedupe languages when enabling them
66bfe14309 cmMakefile: Refactor parameter and variable names for EnableLanguage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7426
2022-07-06 09:16:34 -04:00
Brad King
c3f53b8280 Merge topic 'docopt'
ee6b429498 Help: Clarify that option() is a boolean

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7434
2022-07-05 17:31:06 -04:00
Michael Hirsch
ee6b429498 Help: Clarify that option() is a boolean
Also describe `option()` behavior in project vs. script mode.
2022-07-05 11:05:54 -04:00
friendlyanon
e3c8012ccd Help: Document enable_language accepting multiple languages 2022-06-30 23:37:15 +02:00
Alexandru Croitor
23bbac941a Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub command
The new sub-command writes a string representation of the
current log level to the output variable given to the
sub-command.

Given that the log-level might be set either via the --log-level
command line option or via the CMAKE_MESSAGE_LOG_LEVEL
cache / regular variables, the priority for each of the log level
sources is as follows, with the first one being the highest:
1) --log-level
2) CMAKE_MESSAGE_LOG_LEVEL regular variable
3) CMAKE_MESSAGE_LOG_LEVEL cache variable
4) default log level (STATUS)

Fixes: #23572
2022-06-28 16:03:22 +02:00
Brad King
d94e09ec88 Merge topic 'cpp-named-module-file-sets'
07bc3b07ec gitlab-ci: test C++ modules using GCC
1b2270aa4e ci: add a Docker image to test out C++ modules with GCC
8c5a53096a Tests/RunCMake/CXXModules: add module-using examples
4151547e2f cmGlobalNinjaGenerator: use `cmModuleMapper` implementation
b43bdaff3c cmCxxModuleMapper: implement support for GCC's module map format
02d0f0e752 cmCxxModuleMapper: add source to handle module mapper contents
a046a45aad cmGlobalNinjaGenerator: add a TODO for header units
386465bf83 cmTarget: add support for C++ module fileset types
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7369
2022-06-17 11:35:12 -04:00
Ben Boeckel
386465bf83 cmTarget: add support for C++ module fileset types
C++ modules have two variants which are of importance to CMake:

  - `CXX_MODULES`: interface modules (those using `export module M;`,
    `export module M:part;`, or `module M:internal_part;`)
  - `CXX_MODULE_HEADER_UNITS`: importable header units

Creating C++ modules or partitions are *not* supported in any other
source listing. This is because the source files must be installed (so
their scope matters), but not part of usage requirements (what it means
for a module source to be injected into a consumer is not clear at this
moment). Due to the way `FILE_SET` works with scopes, they are a perfect
fit as long as `INTERFACE` is not allowed (which it is not).
2022-06-16 10:28:34 -04:00
Marc Chevrier
f3b5a7d6df find_(program,library,file,path): add validation function
Fixes: #23603
2022-06-14 16:17:46 -04:00
Brad King
9f16821ea5 Merge topic 'fetchcontent-global-targets'
f19b48e0b8 FetchContent: Honor CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7347
2022-06-11 06:13:58 -04:00
Brad King
012eb49263 Merge topic 'fetchcontent-global-targets' into release-3.24
f19b48e0b8 FetchContent: Honor CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7347
2022-06-11 06:13:57 -04:00
Craig Scott
1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword 2022-06-10 18:08:36 +10:00
Brad King
ea65362f98 Merge topic 'doc-using-deps-guide'
92e93f5c9e Help: Overhaul and expand the Using Dependencies Guide

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !7332
2022-06-09 09:03:14 -04:00
Brad King
9d43059132 Merge topic 'doc-using-deps-guide' into release-3.24
92e93f5c9e Help: Overhaul and expand the Using Dependencies Guide

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !7332
2022-06-09 09:03:13 -04:00
Craig Scott
92e93f5c9e Help: Overhaul and expand the Using Dependencies Guide
The guide previously only focused on the find_package() command,
with a bias towards libraries. FetchContent was not mentioned at all.
Reorganise and update the existing content. Add new sections to cover
providing dependencies with FetchContent and dependency providers.
Improve discoverability of the guide by mentioning it at the beginning
of the find_package(), FetchContent and dependency provider docs.
2022-06-09 22:55:11 +10:00
Brad King
ab1edff492 Merge topic 'if-command-PATH_EQUAL'
be4b9e10af if command: Add PATH_EQUAL operator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7321
2022-06-06 09:47:45 -04:00
Craig Scott
afcf275cc9 Help: Fix formatting and missing cross-reference for find_package()
Amends 42f7e39789 (Find: Support per call disabling of
CMAKE_INSTALL_PREFIX, 2022-03-21)
2022-06-05 17:55:50 +10:00
Craig Scott
8cf8f4d13b Help: State behavior for add_custom_command(TARGET) without event type
Projects should always have specified one of PRE_BUILD, PRE_LINK or
POST_BUILD, and the documentation has always shown that one must
be given. But the argument parsing logic was such that if none was given,
POST_BUILD would be used and no error or warning would be raised.
Projects may be relying on this behavior, so document it as formally
supported, but not recommended.

Fixes: #23488
2022-06-04 18:35:37 +10:00
Marc Chevrier
be4b9e10af if command: Add PATH_EQUAL operator 2022-06-03 19:31:36 +02:00
Marc Chevrier
4d1883df11 Genex-PATH_EQUAL: path comparison
To complete issue #23498
2022-06-01 15:28:54 +02:00
Marc Chevrier
f11e66670b Genex-PATH: path handling
Fixes: #23498
2022-05-31 15:39:51 +02:00
Brad King
5dcf505f63 Merge topic 'dependency-providers'
2aa83fa15b Dependency providers: Add find_package and FetchContent support
8a28368feb FetchContent: Don't discard non-empty SOURCE_DIR and BINARY_DIR
8ce9bb8a0c FetchContent: Don't leak internal variables
74a6ddc339 cmFindPackageCommand: Handle Makefile variable definitions more robustly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !7276
2022-05-25 07:24:48 -04:00
Craig Scott
2aa83fa15b Dependency providers: Add find_package and FetchContent support
Fixes: #22619
2022-05-25 08:46:18 +10:00
Marc Chevrier
98af010b5c Help: Avoid duplicating registry query syntax in multiple find_* commands
In commit 8d7e80cf3d (find_* commands: add control over Windows registry
views, 2022-04-16) we added documentation that is repeated by multiple
find commands.  Move it to a dedicated manual section to avoid duplication.
2022-05-18 12:43:58 -04:00
Brad King
a7cd15a61c Merge topic 'try_compile-project-platform-vars'
a6562ff579 try_compile: Add option to skip passing platform variables
4843a37676 try_compile: Propagate platform variables in project-mode too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7265
2022-05-17 08:57:55 -04:00
Brad King
a6562ff579 try_compile: Add option to skip passing platform variables
Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell
`try_compile` not to pass platform variables to the test project.

Issue: #23219
2022-05-16 10:47:21 -04:00
Brad King
4843a37676 try_compile: Propagate platform variables in project-mode too
Add policy CMP0137 to propagate both our builtin variables and those
listed by `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` to `try_compile`
whole-project builds.

Inspired-by: Alexander Neumann <Alexander.Neumann@hamburg.de>
Fixes: #23219
2022-05-16 10:39:42 -04:00
Brad King
c4ed5341c4 Merge topic 'CMAKE_PROJECT_TOP_LEVEL_INCLUDES'
a6c34b0353 project(): Add new CMAKE_PROJECT_TOP_LEVEL_INCLUDES file injection point
8aa29a1793 CMakeDetermineSystem: Remove unreachable code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7250
2022-05-16 09:26:59 -04:00
Brad King
392e73e01a Merge topic 'doc-install-example-components'
308b698f5d Help: Make install() example component names more consistent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7240
2022-05-13 08:46:58 -04:00
Craig Scott
a6c34b0353 project(): Add new CMAKE_PROJECT_TOP_LEVEL_INCLUDES file injection point
Fixes: #22685
2022-05-13 18:03:36 +10:00
Jean-Christophe Fillion-Robin
308b698f5d Help: Make install() example component names more consistent
This commit updates the documentation so that the component examples are
specified using title case to match convention used in both the existing
`Installing Exports` section and in the "Mastering CMake" book.
2022-05-12 10:15:42 -04:00
Cameron Cawley
33da5824ac OpenWatcom: Allow specifying the runtime library
Add a `CMAKE_WATCOM_RUNTIME_LIBRARY` variable to control the
runtime library selection.  Add policy CMP0136 to switch to
in place of the old hard-coded default flags.

Fixes: #23178
2022-05-06 10:40:58 -04:00
Craig Scott
c5dff5ace2 Merge topic 'FetchContent_find_package_integration'
29e31e2825 Packages: Integrate FetchContent and find_package()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: huangqinjin <huangqinjin@gmail.com>
Merge-request: !5688
2022-05-06 08:33:38 -04:00
Brad King
8a40680524 Merge topic 'HelpExit'
0aea13d20b Help: for message(FATAL_ERROR), document nonzero exit code
cc97725137 Help: document exit code of command cmake(1)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7175
2022-05-05 12:51:47 -04:00
Brad King
213f391715 Merge topic 'HelpEnv'
a693da21f3 Help: from command:if, link to environment variables
ab2bdbaf31 Help: Cross-reference ENV operator from cmake-language(7) manual
ee4e728a69 Help: From Environment Variables section, link to cmake -E env etc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7239
2022-05-05 12:50:53 -04:00
Joachim Wuttke (h)
0aea13d20b Help: for message(FATAL_ERROR), document nonzero exit code 2022-05-05 09:43:39 -04:00
Joachim Wuttke (h)
a693da21f3 Help: from command:if, link to environment variables 2022-05-05 09:37:20 -04:00
Brad King
bdaa4b8459 Merge topic 'chsi-windows_registry-updates'
0c33f12a39 cmake_host_system_information(WINDOWS_REGISTRY) updates

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7229
2022-05-04 11:10:12 -04:00
Craig Scott
29e31e2825 Packages: Integrate FetchContent and find_package()
Allow FetchContent_MakeAvailable() to try a call to
find_package() first, or redirect a find_package() call to
FetchContent_MakeAvailable(). The user can set variables
to control which of these are allowed or tried by default.

Fixes: #21687
2022-05-03 16:48:11 +10:00
Marc Chevrier
0c33f12a39 cmake_host_system_information(WINDOWS_REGISTRY) updates
* add a cross-reference in 'get_filename_component()' documentation
* rework tests for better 32bit systems support
2022-05-01 12:57:24 +02:00
Marc Chevrier
8d7e80cf3d find_* commands: add control over Windows registry views
Fixes: #22775
2022-04-29 22:00:02 +02:00
Brad King
1bd85e8f3f Merge topic 'NO_CMAKE_INSTALL_PREFIX'
42f7e39789 Find: Support per call disabling of CMAKE_INSTALL_PREFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7163
2022-04-22 08:59:09 -04:00
Brad King
a0601e346b Merge topic 'find_package_document_global_in_full_signature'
b3e1fcf20a Help: Clarify that find_package GLOBAL argument is supported in full signature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7180
2022-04-21 11:51:39 -04:00
Robert Maynard
b3e1fcf20a Help: Clarify that find_package GLOBAL argument is supported in full signature
This was accidentally left out of the docs by commit 2f1ffa003c
(find_package: Add support for default GLOBAL imported targets,
2022-03-10).
2022-04-20 12:38:56 -04:00
Robert Maynard
42f7e39789 Find: Support per call disabling of CMAKE_INSTALL_PREFIX
Fixes #23359
2022-04-15 09:33:55 -04:00
Brad King
1cf59d5267 Merge topic 'file-set-generated-dependency'
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Gabriel Nützi <gnuetzi@gmail.com>
Merge-request: !7173
2022-04-15 08:23:57 -04:00
Kyle Edwards
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem
If an INTERFACE library has HEADER_SETS, and its header sets contain
files generated by a custom command, the library needs to participate in
the buildsystem so that the files will be generated.

Fixes: #23422
2022-04-14 09:17:54 -04:00
Marc Chevrier
17ff86547e cmake_host_system_information: query windows registry
Fixes: #21240, #23367
2022-04-13 08:59:08 -04:00
Brad King
9a7d8394b1 Merge topic 'header-sets-no-framework'
f779f8c0ad FILE_SET: Forbid adding header sets to Apple FRAMEWORK libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !7149
2022-04-07 10:54:30 -04:00
Kyle Edwards
f779f8c0ad FILE_SET: Forbid adding header sets to Apple FRAMEWORK libraries
The feature needs a specialized implementation to place headers
in the right place inside frameworks.  To avoid silently doing
the wrong thing, make this case an error for the 3.23 series.

Issue: #23386
2022-04-07 09:26:58 -04:00
Craig Scott
ce121e486c Merge topic 'doc-install-typo'
7431759ebc Help: Fix typo in install command documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7140
2022-04-04 07:46:55 -04:00
Eugene Shalygin
7431759ebc Help: Fix typo in install command documentation 2022-04-04 07:38:29 +10:00
Brad King
025b86cc17 Merge topic 'help-json-length-empty-index'
2f0a3d43e1 Help: Fix string(JSON ... LENGTH ...) signature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7126
2022-03-31 08:48:18 -04:00
Tobias Nießen
2f0a3d43e1 Help: Fix string(JSON ... LENGTH ...) signature
The list of indices and/or member names is optional, i.e., can be
empty. For example, string(JSON foo LENGTH "[0,0,0]") sets foo to 3.
2022-03-30 09:14:13 -04:00
Kasper Laudrup
0b7fd783f8 cmake -E tar: Add --touch option
Similar to GNU tar add a --touch option to the tar extract command to
skip extracting the timestamps from the files in the archive
effectively touching them as if they were just created.

Issue: #22746
2022-03-23 14:41:34 +01:00
Brad King
00563063c0 Merge topic 'initialize-property-name'
26caa97057 define_property(): Change constraints of INITIALIZE_FROM_VARIABLE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7103
2022-03-23 09:32:11 -04:00
Kyle Edwards
26caa97057 define_property(): Change constraints of INITIALIZE_FROM_VARIABLE
Remove the requirement that the variable name have a prefix while
keeping the suffix requirement. Require that the property name
contains an underscore. Update docs and tests accordingly.

Fixes: #23340
2022-03-23 16:39:32 +11:00
Brad King
bbfc6215aa Merge topic 'cleanup-define_property'
87c3b5e421 define_property(): Only test prefix if INITIALIZE_FROM_VARIABLE is given
9b50f221f6 Help: Update the main purpose of define_property()
e993e2c52c Help: Clean up INITIALIZE_FROM_VARIABLE define_property() option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !7090
2022-03-22 08:55:15 -04:00
Brad King
2f3cf60711 Merge topic 'cleanup-define_property' into release-3.23
87c3b5e421 define_property(): Only test prefix if INITIALIZE_FROM_VARIABLE is given
9b50f221f6 Help: Update the main purpose of define_property()
e993e2c52c Help: Clean up INITIALIZE_FROM_VARIABLE define_property() option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !7090
2022-03-22 08:55:14 -04:00
Brad King
67ce80ac71 Merge topic 'doc-test-property-genex'
78e0204e81 Help: Clarify when add_test and test properties support generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7101
2022-03-22 08:52:12 -04:00
Brad King
78e0204e81 Help: Clarify when add_test and test properties support generator expressions
Issue: #23329
2022-03-21 15:46:50 -04:00
Craig Scott
9b50f221f6 Help: Update the main purpose of define_property()
The BRIEF_DOCS and FULL_DOCS are remnants from before the
Sphinx-based documentation when CMake's internal structures
for defining properties included fields for their documentation.
They are no longer mandatory for define_property() and haven't
been in practical use for some time. The main use of the command
has evolved to now be more about how to initialize and inherit
properties, so update the docs to reflect that change in focus.

Issue: #20698
2022-03-19 17:33:45 +11:00
Craig Scott
e993e2c52c Help: Clean up INITIALIZE_FROM_VARIABLE define_property() option
INITIALIZE_FROM_VARIABLE is new in CMake 3.23, but the
versionadded note was missing in the original commit. The docs
also failed to mention that the new option only applies to target
properties.

Amends fce24e4f10 (define_property(): Add INITIALIZE_FROM_VARIABLE
argument, 2022-01-13)
2022-03-19 17:33:45 +11:00
Brad King
cffc2b6942 Merge topic 'doc-ignore-prefix-paths'
5cb0a730c9 Help: Clarify behavior of search ignore-related variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7056
2022-03-15 12:48:42 -04:00
Craig Scott
5cb0a730c9 Help: Clarify behavior of search ignore-related variables
Not all the behaviors of CMake variables for ignoring search
locations by find_...() commands were fully documented.
Add the missing effects, clarify the wording and restructure the
way the details are assembled to reduce duplication.

Also improve the cross-referencing to ensure all the related
variables are more discoverable.

Issue: #20878
2022-03-13 14:29:05 +11:00
John Parent
2f1ffa003c find_package: Add support for default GLOBAL imported targets
Allow find package to promote scope of imported targets by specifying
an argument to `find_package` or by specifying a CMake variable.
    * Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable
    * Add support for GLOBAL argument to find_package

Additionally add testing for above features.
2022-03-10 12:44:36 -05:00
Brad King
cbd36eac23 Merge topic 'ctest_truncate'
140704d443 ctest: add option for output truncation
359e5b17d8 presets: bump version to v5
4634de335b cmCTestTestHandler: refactor CleanTestOutput method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6993
2022-03-09 12:17:44 -05:00
Brad King
363a0d6010 Merge topic 'doc-file-sets'
4286b72240 Help: Update install() docs to better reflect preference for file sets
ab1b573f41 Help: Reorganise FILE_SETS and related properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7031
2022-03-09 12:07:58 -05:00
Frank Winklmeier
140704d443 ctest: add option for output truncation
Add `--test-output-truncation` to `ctest`. This option can be used to
customize which part of the test output is being truncated. Currently
supported values are `tail`, `middle` and `head`.

Also add equivalent `CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable.

Fixes: #23206
2022-03-08 08:18:02 -05:00
Craig Scott
4286b72240 Help: Update install() docs to better reflect preference for file sets
Previously, headers would typically be installed as bare files or
as whole directories. File sets offer a better abstraction and
associate headers with a target, installing them as part of the
target. Add notes and update examples to draw the reader's
attention to the advantages of file sets for headers.
2022-03-08 19:38:56 +11:00
Craig Scott
ab1b573f41 Help: Reorganise FILE_SETS and related properties
Reduce duplication and make the docs for target_sources() focus
on the functionality rather than the properties it modifies.
The properties are a lower level quantity, so put the relevant
details for them in the property documentation. The target_sources()
command only needs to reference the properties, not reproduce
the property documentation.

Improve the cross-referencing between the HEADER_... property
docs. This helps build the mental picture of how they relate to
each other.
2022-03-05 17:33:36 +11:00
Brad King
89457cb8f0 Merge topic 'file-set-name-requirements'
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7037
2022-03-04 09:09:33 -05:00
Brad King
65da32c924 Merge topic 'file-set-name-requirements' into release-3.23
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7037
2022-03-04 09:09:31 -05:00
Brad King
0d8bb14344 Merge topic 'file-set-multiple-names'
8c23ecbd93 target_sources(): Process multiple FILE_SET arguments per block

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7040
2022-03-04 09:07:04 -05:00
Kyle Edwards
8c23ecbd93 target_sources(): Process multiple FILE_SET arguments per block
Fixes: #23287
2022-03-03 14:31:54 -05:00
Kyle Edwards
b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name
Fixes: #23286
2022-03-03 10:17:10 -05:00
Brad King
1ed1edbfd1 Merge topic 'file-set-no-custom-targets'
ad41c9cd11 target_sources(): Prohibit FILE_SET on custom targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7027
2022-03-02 07:45:58 -05:00
Kyle Edwards
ad41c9cd11 target_sources(): Prohibit FILE_SET on custom targets
Fixes: #23262
2022-02-28 17:21:04 -05:00
m.klimenko
231872ddb0 file(DOWNLOAD): Add options to download a range 2022-02-15 22:08:06 +03:00
Brad King
19b273b729 Help: Organize and clarify export() command documentation
Add section headers for each signature, and a synopsis linking to them.
Re-order sections to introduce the main `export(TARGETS)` functionality
before mentioning the `export(EXPORT)` shorthand, which may be confused
with `install(EXPORT)`.

Fixes: #23221
2022-02-14 12:16:50 -05:00
Brad King
41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions
The wording update in commit b74819e4fe (Help: Format 'if' command
documentation, 2013-12-18, v3.0.0-rc1~227^2~1) incorrectly implied that
`AND` has higher precedence than `OR`.  Although this is common in many
languages, it has never been true in CMake's implementation.  Revise
the wording to clarify the precedence.

Add a test case demonstrating the order.

Fixes: #23207
2022-02-09 14:24:43 -05:00
Brad King
ec29a6a1a9 Help: Clarify documentation on SYSTEM include directories
Mention that system include directories are searched after normal
include directories.

Document that `IMPORTED_NO_SYSTEM` and `NO_SYSTEM_FROM_IMPORTED`
do not affect `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`.
2022-02-03 06:21:37 -05:00
Brad King
983df681c8 Merge topic 'help-try-compile-result-var'
34d263270e Help: Drop incorrect versionadded for try_compile result variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6923
2022-02-01 09:50:41 -05:00
friendlyanon
34d263270e Help: Drop incorrect versionadded for try_compile result variable
In commit c705279bae (Help: Add `.. versionadded` directives to commands
documentation, 2020-11-08, v3.20.0-rc1~508^2) we accidentally added
``versionadded`` markup suggesting that the first argument to
`try_compile` was fixed as `RESULT_VAR` prior to CMake 3.14.  This was
probably due to misinterpreting the change from commit 7975edeac5 (Help:
User-provided variable names for try_* commands, 2019-02-24,
v3.14.0-rc3~16^2~3).

The result variable has never been fixed.  Drop the incorrect markup.
2022-01-31 10:59:56 -05:00
Craig Scott
3efa3251e9 Help: Clarify relative path handling for target_include_directories()
Fixes: #22853
2022-01-31 16:24:07 +11:00
Peter Würth
c050d6a01e string(TIMESTAMP): add %f specifier for microseconds
The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP)
commands to output the timestamp with a microsecond resolution.
This convention is offered by python's datetime module.
Before, the precision was limited to seconds.

The implementation is done by extending existing cmTimestamp methods
with a `microseconds` parameter. This parameter is optional in order to
be backwards compatible. The timestamps are now received in a
cross-platform manner using libuv, since the standard C functions like
time() don't allow for sub-second precision.

This requires libuv 1.28 or higher.  We already require higher than
that on Windows, so update the required version for other platforms.

Implements: #19335
2022-01-28 06:23:57 -05:00
Kyle Edwards
b7cd51d18a Help: Note the version in which define_property() arguments became optional 2022-01-21 09:24:15 -05:00
Kyle Edwards
fce24e4f10 define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
2022-01-20 09:05:35 -05:00
Brad King
196243d668 Merge topic 'define-property-optional-args'
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
7d26baff46 cmDefinePropertyCommand: Refactor to use cmArgumentParser

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6875
2022-01-19 09:06:58 -05:00
Kyle Edwards
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
Issue: #20698
2022-01-18 15:52:01 -05:00
Marc Chevrier
e04a352cca Depfile parsing: enhance compatibility with GNU Make 2022-01-16 14:05:59 +01:00
Marc Chevrier
8a3aac990e Help: add_custom_command: describes depfile format 2022-01-11 12:51:11 +01:00
Craig Scott
6b170578b8 Help: Non-zero floating point numbers are true in if() expressions
Fixes: #22991
2022-01-04 08:45:23 +11:00
Adriaan de Groot
b151db01f9 Help: mention non-existent case for list(PREPEND) 2021-12-21 10:55:43 -05:00
Adriaan de Groot
b3a249c2cb Help: clarify range for list(INSERT), mention nonexistent / empty case 2021-12-21 10:55:35 -05:00
Adriaan de Groot
b6fdcb3df0 Help: clarify description of list(INSERT)
Since the argument is called 'index', use that in the description.
2021-12-21 10:55:32 -05:00
Adriaan de Groot
e55f473ea9 Help: clarify that list(APPEND) on a non-existent list creates it
This is hinted-at in the introduction, which mentions creating
a new variable value in the current scope, but let's make it
explicit.

Fixes: #22910
2021-12-21 10:55:22 -05:00
Craig Scott
a45e922768 Help: Clarify behavior of if(DEFINED) for cache and non-cache variables
Fixes: #23023
2021-12-20 19:27:39 +11:00
Brad King
1c77801636 Merge topic 'doc-if-basic-expressions'
294581a443 Help: Be more explicit about the behavior of if(<string>)
3a9695557d Help: Explicitly state that if(ENV{some_var}) is always false

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6768
2021-12-01 09:37:41 -05:00
Craig Scott
294581a443 Help: Be more explicit about the behavior of if(<string>) 2021-12-01 18:59:23 +11:00
Craig Scott
3a9695557d Help: Explicitly state that if(ENV{some_var}) is always false 2021-12-01 18:30:26 +11:00
Brad King
39624cc911 Merge topic 'doc-tests-labels-dynamic'
250acbb099 Help: Improve cross-referencing of test LABELS and related features
a77bdefa3e Help: Add missing version details for Additional Test Measurements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6726
2021-11-15 09:24:42 -05:00
Craig Scott
250acbb099 Help: Improve cross-referencing of test LABELS and related features 2021-11-13 20:45:05 +11:00
Craig Scott
a77bdefa3e Help: Add missing version details for Additional Test Measurements 2021-11-13 20:44:05 +11:00
Brad King
e0a66059d4 Help: Fix target_sources FILE_SET signature summary
The `FILE_SET <set>` argument is required to activate this signature.
2021-11-05 10:24:12 -04:00
Brad King
79d379fba6 Help: Add versionadded markup to target_sources FILE_SET feature
This was accidentally left out of commit 4b0ee4e338 (Help: Add
documentation for target_sources(FILE_SET) and associated properties,
2021-07-02).
2021-11-05 10:19:10 -04:00
Brad King
5ca6b724d3 Merge topic 'doc-SOURCES-genex'
9fac18a4a6 Help: Clarify target_sources path conversion w.r.t generator expressions
9abd63dd3a Help: Explain how target SOURCES are interpreted

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6692
2021-11-05 10:04:44 -04:00
Brad King
fc3f20a40f Merge topic 'doc-TARGET_RUNTIME_DLLS'
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !6700
2021-11-04 09:07:48 -04:00
Brad King
85771bbf00 Merge topic 'doc-TARGET_RUNTIME_DLLS' into release-3.22
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !6700
2021-11-04 09:07:47 -04:00
Arcturus Arcturus
9fac18a4a6 Help: Clarify target_sources path conversion w.r.t generator expressions
With some of the content expanded, reorder a few paragraphs
and tweak some of the wording to improve the flow.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-11-04 20:24:19 +11:00
Brad King
001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets
This generator expression does not report the locations of `.dll`
files on imported targets with the `UNKNWON` type, since their
`IMPORTED_LOCATION` refers to the import library and not the DLL.

Fixes: #22845
2021-11-03 16:17:17 -04:00
Brad King
22ab2488c9 Merge topic 'doc-configure_file-creates-directories'
fa47e9c8f9 Help: Document that configure_file can create directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6675
2021-10-29 08:51:24 -04:00
Marc Aldorasi
fa47e9c8f9 Help: Document that configure_file can create directories 2021-10-28 12:48:25 -04:00
Kyle Edwards
4b0ee4e338 Help: Add documentation for target_sources(FILE_SET) and associated properties 2021-10-27 15:17:23 -04:00
Arcturus Arcturus
1560265e7d Help: Fix file(INSTALL) docs w.r.t. CMAKE_INSTALL_MESSAGE
In commit c9568de52c (install: Add CMAKE_INSTALL_MESSAGE variable
(#13761), 2014-06-24, v3.1.0-rc1~370^2~1) we incorrectly documented
that `CMAKE_INSTALL_MESSAGE` controls the status message for
`file(INSTALL)`.  Revert that.

Fixes: #17162
2021-10-20 12:48:04 -04:00
Robert Maynard
67f8d20a8e Help: clarify list(POP_* <in_out> <in_out>) behavior 2021-10-14 08:53:17 +11:00
Craig Scott
96937438b7 Help: Clean up how TLS and NETRC variables are discussed
Mention of the fallback of the command options to the CMAKE_...
variables was repeated in places. The wording was also a bit
unclear about whether the fallback only occurred when neither
TLS or neither NETRC option was given to the command. Move
the fallback details directly to each relevant option instead.

Also use cross-referencing to the variables where it was not
linked previously.
2021-10-04 22:03:32 +11:00
Craig Scott
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO 2021-10-04 21:48:00 +11:00
Craig Scott
84e02be51c Help: Restructure the find_package() docs
The explanation of the basic and full signatures was interwoven tightly
with that of the Module and Config search modes. Config mode is
supported by both signatures, which made the structure of the
command documentation a bit confusing.

Add a section at the start which unambiguously describes the two
modes, including the fallback functionality between them. Move the
text about this out of the basic signature section, leaving just a
description of the basic syntax with a note that it is supported by both
search modes. This makes the basic signature section more focused.

Drop the Module and Config mode parts of the titles for the basic and
full signature sections. Those are now more precisely covered by the
new opening section, so the Basic Signature and Full Signature sections
are now clearer in what they cover.

Swap the order of the Search Procedure and Version Selection sections
to improve the logical flow. Also add  "Config Mode" to their titles to
make it clearer what they apply to. Add a note at the start of both
sections to highlight their relationship to the basic and full signatures.
2021-09-23 21:56:33 +10:00
Craig Scott
dadb7a2ba5 Merge topic 'document_find_package_version_restrictions'
563139e5e9 Help: find_package document version only supports numeric components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6510
2021-09-11 04:39:10 -04:00
Brad King
a4fccf74af Merge topic 'ctest-memcheck-generate-test.xml'
ce44c2cec3 ctest_memcheck: generate `DynamicAnalysis-Test.xml` as well

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6491
2021-09-10 09:29:42 -04:00
Robert Maynard
563139e5e9 Help: find_package document version only supports numeric components 2021-09-09 15:02:30 -04:00
Ben Boeckel
ce44c2cec3 ctest_memcheck: generate DynamicAnalysis-Test.xml as well
This is useful so that memcheck results also show up as test results on
CDash. It will be submitted with the other `MemCheck` parts.

Fixes: #22190
2021-09-08 21:04:46 -04:00
Johel Ernesto Guerrero Peña
c6a6c008f4 Help: Fix terminology for regular expression in if(MATCHES)
This was wrongly changed in commit ba90611225 (Help: Make synopsis of
if command more compact; add section headers, 2018-10-05).
2021-08-28 13:58:25 +10:00
Brad King
b0a24db270 Merge topic 'find-package-note'
d7e521bcd3 Help: find_package: Tweak change description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6477
2021-08-25 09:19:04 -04:00
Brad King
cf90aa5595 Merge topic 'host-distro-info'
b9698f89df cmake_host_system_information: Make it available for all systems
5469c71a82 Refactor: Simplify `GetValue()` function calls
6c92f80f2e cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT`
efe139d1b8 cmake_host_system_information: Can run fallback scripts
1e65e4a6e5 cmake_host_system_information: Can read `/etc/os-release` file
e808cbb1dd Testing: Convert `cmake_host_system_information` tests into `RunCMake`
9e831284e5 Documentation: Use definition list instead of tables
346f3de005 Refactor: Deduplicate code for `VS_nn_DIR` keys processing
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6410
2021-08-24 10:04:15 -04:00
FeRD (Frank Dana)
d7e521bcd3 Help: find_package: Tweak change description 2021-08-23 20:02:08 -04:00
FeRD (Frank Dana)
0c0ba17493 Help: get/set_property: Fix SOURCE grammars 2021-08-23 18:38:13 -04:00
Alex Turbov
b9698f89df cmake_host_system_information: Make it available for all systems
Before it was Linux only.
2021-08-20 09:35:12 -04:00
Alex Turbov
efe139d1b8 cmake_host_system_information: Can run fallback scripts 2021-08-20 09:35:12 -04:00
Alex Turbov
1e65e4a6e5 cmake_host_system_information: Can read /etc/os-release file 2021-08-20 09:35:09 -04:00
Brad King
8706f7a617 Merge topic 'symlinks-rebase-master'
58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6396
2021-08-10 09:25:15 -04:00
Craig Scott
ff687c07bf Merge topic 'doc-find_package-components'
b7d4567769 Help: Clarify find_package() component handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6436
2021-08-09 18:03:12 -04:00
Brad King
185e9d1619 Merge topic 'help_cmake_path'
bb19af546b Help: cmake_path: add missing parameter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6431
2021-08-09 09:37:58 -04:00
Craig Scott
b7d4567769 Help: Clarify find_package() component handling
Fixes: #22513
2021-08-09 08:01:47 +10:00
Michael Hirsch
bb19af546b Help: cmake_path: add missing parameter
for cmake_path(`CONVERT` ... [NORMALIZE]) was missing in top summary
2021-08-06 11:55:53 -04:00
Brad King
70daea512d Merge topic 'string-TIMESTAMP-specifier-V'
aafa392c12 string(TIMESTAMP): Add %V specifier for ISO 8601 week number
a915f691ad Help: Format string(TIMESTAMP) format specifiers as a definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6374
2021-08-03 11:08:34 -04:00
Brad King
cf49b5fb6b Merge topic 'help-get_filename_path-fix-version-changed'
8b28fe5670 Help: get_filename_component: fix version info for cmake_path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6423
2021-08-03 10:57:44 -04:00
Felix Lelchuk
58d10cf6f1 Alternative symlink-creating mode for file(INSTALL ...)
An new environment variable 'CMAKE_INSTALL_MODE' is introduced,
which can be used to ask CMake to create symbolic links
instead of copying files during a file(INSTALL ...).

The operation is at the file level only, directory trees are
still created using actual directories, not links.

Signed-off-by: Felix Lelchuk <felix.lelchuk@gmx.de>
2021-08-02 19:42:26 +02:00
Antons Jeļkins
aafa392c12 string(TIMESTAMP): Add %V specifier for ISO 8601 week number
In ISO 8601 weeks begin with Monday. The first week of
the year is the week which contains the first Thursday
of the year.
2021-08-02 16:31:53 +02:00
Marc Chevrier
8b28fe5670 Help: get_filename_component: fix version info for cmake_path
Fixes: #22505
2021-08-02 11:12:46 +02:00
Alex Turbov
9e831284e5 Documentation: Use definition list instead of tables
Transform tables into definition list for `cmake_host_system_information`
command manual.
2021-07-30 03:40:13 +03:00
Brad King
0079f24f45 Merge topic 'doc-custom-command-depfiles' into release-3.21
f6e5743d0e Help: Clarify and correct wording around DEPFILE option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6387
2021-07-26 09:39:55 -04:00
Brad King
2cc59a80b8 Merge topic 'doc-custom-command-depfiles'
f6e5743d0e Help: Clarify and correct wording around DEPFILE option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6387
2021-07-26 09:39:55 -04:00
Craig Scott
18259fa689 Merge topic 'doc-ctest-output'
ba6d1947b6 Help: Add cross-references between test output size ctest variables
cdde9e5a10 Help: Improve wording and cross-referencing for ctest JUnit output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6389
2021-07-26 07:48:02 -04:00