Commit Graph

1426 Commits

Author SHA1 Message Date
FeRD (Frank Dana)
6c3311d53b Help: Document property redefinition semantics
Add a section to the `define_property()` documentation which
details the behavior when attempting to redefine an existing
property. (The command is silently ignored.)

Provide an example using `get_property()` to examine a property
definition created with `define_property()`.
2024-01-29 05:23:37 -05:00
Brad King
951656385d Merge topic 'doc-get-properties-inherited'
8086badba4 Help: Fix wrong return values for unset inherited properties
1ca5ec67b0 Help: Add missing DIRECTORY keyword to set_tests_properties() signature
34379f005b Help: Use <variable> consistently in property getter commands
29ccc9a4cd Help: Use <xxx> for non-keyword arguments in property command signatures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9131
2024-01-05 10:18:42 -05:00
Craig Scott
8086badba4 Help: Fix wrong return values for unset inherited properties
Since ff6234509e (Help: Clarify behavior of INHERITED properties, 2018-03-21),
the docs for some get_..._property() commands incorrectly describe
the behavior for inherited properties. When a property is not set, even
in a parent scope, the returned result from the get_..._property()
command is the same whether the property is inherited or not.
The docs incorrectly stated that an empty string would be returned
for inherited properties in such cases.
2024-01-05 17:40:16 +11:00
Craig Scott
1ca5ec67b0 Help: Add missing DIRECTORY keyword to set_tests_properties() signature 2024-01-05 16:45:27 +11:00
Craig Scott
34379f005b Help: Use <variable> consistently in property getter commands
Property-related commands used a mix of <VAR>, <var>, or
<variable> to specify the variable to store the result in. The <VAR>
form is particularly confusing, since being uppercase it looks more
like a keyword. Use <variable> consistently across all the commands
so that the behavior is clear.
2024-01-05 15:37:39 +11:00
Craig Scott
29ccc9a4cd Help: Use <xxx> for non-keyword arguments in property command signatures 2024-01-05 15:31:39 +11:00
Brad King
2b4bc8d469 Merge topic 'HELP-string_LENGTH-link-error'
9702a01dc9 Help: string(LENGTH): Fix synopsis link to command description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9113
2024-01-04 11:44:14 -05:00
Brad King
f11f0f52b7 Merge topic 'HELP-string_LENGTH-link-error' into release-3.28
9702a01dc9 Help: string(LENGTH): Fix synopsis link to command description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9113
2024-01-04 11:44:13 -05:00
Marc Chevrier
9702a01dc9 Help: string(LENGTH): Fix synopsis link to command description
Make the link target explicit to avoid ambiguity with `JSON LENGTH`.

Fixes: #25546
2024-01-03 14:14:18 -05:00
Brad King
a350d92c06 Merge topic 'add_test-CROSSCOMPILING_EMULATOR-exclusive'
ca5a300d7f add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8947
2023-12-20 09:09:48 -05:00
Ralf Habacker
ca5a300d7f add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compiling
Add policy CMP0158 to provide compatibility for existing projects.

Fixes: #23672
2023-12-19 10:00:55 -05:00
Craig Scott
d0ab70d57d Help: Fix typo in dependency provider method keyword
The cmake.vim file is generated by scanning for keyword-like
strings in the docs. Update the corresponding wrong entry
there too directly for now, which will fix the wrong entry until
the next full regeneration of the file.

Fixes: #25503
2023-12-16 10:27:39 +11:00
Brad King
6ba3bb0563 Merge topic 'cmake-test-launcher'
88863d83d6 fileapi: Add test launcher to codemodel-v2
1ec0372ed4 add_test: Optionally use a launcher for tests running in-project targets
478a5f4e04 fileapi: Make launcher attribute 'arguments' optional
b44e38a397 cmFileAPICodemodel: Add missing std::move()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8963
2023-12-15 09:34:20 -05:00
Ralf Habacker
1ec0372ed4 add_test: Optionally use a launcher for tests running in-project targets
Add a `CMAKE_TEST_LAUNCHER` variable and corresponding `TEST_LAUNCHER`
target property.

Issue: #23672
2023-12-13 10:20:43 -05:00
Brad King
f522cf4546 Merge topic 'doc-xcframeworks-stubs-apple'
e831eef933 Help: Note case where IMPORTED_IMPLIB isn't needed for (xc)frameworks
01735badee Help: XCFrameworks and stubs are supported on all Apple, not just macOS
6ac50df591 Help: Add missing versionadded directives for IMPORTED_IMPLIB

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9058
2023-12-13 09:34:51 -05:00
Brad King
ef6aec22a1 Merge topic 'doc-xcframeworks-stubs-apple' into release-3.28
e831eef933 Help: Note case where IMPORTED_IMPLIB isn't needed for (xc)frameworks
01735badee Help: XCFrameworks and stubs are supported on all Apple, not just macOS
6ac50df591 Help: Add missing versionadded directives for IMPORTED_IMPLIB

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9058
2023-12-13 09:34:50 -05:00
Brad King
532c30a654 Merge topic 'Help-create_test_sourcelist'
464bc12bb7 Help/create_test_sourcelist: format arguments in the signature docs
131f9c9efa Help/create_test_sourcelist: add formatting markup
8540520902 Help/create_test_sourcelist: reflow prose

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9059
2023-12-12 08:35:07 -05:00
Ben Boeckel
464bc12bb7 Help/create_test_sourcelist: format arguments in the signature docs 2023-12-09 23:15:29 -05:00
Ben Boeckel
131f9c9efa Help/create_test_sourcelist: add formatting markup 2023-12-09 10:17:45 -05:00
Ben Boeckel
8540520902 Help/create_test_sourcelist: reflow prose 2023-12-09 10:17:16 -05:00
Craig Scott
01735badee Help: XCFrameworks and stubs are supported on all Apple, not just macOS 2023-12-09 16:15:19 +11:00
Brad King
e1519edd91 Help: Use signature directive for the 'add_library' command
This allows individual signatures to be cross-referenced from elsewhere.
It also associates with each signature its main documentation via
indentation.
2023-12-06 13:05:23 -05:00
Brad King
bfc9e71d1f Help: Use signature directive for the 'add_executable' command
This allows individual signatures to be cross-referenced from elsewhere.
It also associates with each signature its main documentation via
indentation.
2023-12-06 13:03:03 -05:00
namniav
7fc6d7247a Help: Fix signature of add_library(<name> INTERFACE EXCLUDE_FROM_ALL)
This signature was added by commit 4391913133 (Add INTERFACE libraries
to generated buildsystem if they have SOURCES, 2020-07-20,
v3.19.0-rc1~346^2~1) with incorrect documentation.

Previously the documented signature as:

    add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])

which is incorrect.  CMake would recognize `EXCLUDE_FROM_ALL` as a source
file and report an error that it doesn't exists.

The correct signature is:

    add_library(<name> INTERFACE [EXCLUDE_FROM_ALL] [<source>...])

which places `EXCLUDE_FROM_ALL` in the same position used by the
documentation of other signatures.

Fixes: #25463
2023-12-04 10:37:01 -05:00
Brad King
cdd741ebf9 Merge branch 'backport-ci-fedora-39' into ci-fedora-39 2023-11-17 11:35:41 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00
Brad King
2c923a7e28 Merge topic 'install-export-xcframework'
37bc3400cd CMakePackageConfigHelpers: Add generate_apple_platform_selection_file()
256bb0cc40 install(EXPORT): Add ability to point to .xcframework file
a90968e044 cmExportBuildFileGenerator: Add structs for target exports

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jason Juang <jasjuang@gmail.com>
Merge-request: !8969
2023-11-16 09:13:16 -05:00
Brad King
e48f2e69b5 Help: Clarify file() command multi-value argument placeholders
Use `<placeholder>...` syntax to imply "zero or more", as we do elsewhere.
2023-11-15 10:56:17 -05:00
Kyle Edwards
256bb0cc40 install(EXPORT): Add ability to point to .xcframework file
Issue: #25262
2023-11-15 09:10:58 -05:00
Kyle Edwards
c6e6861e63 install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
2023-11-13 11:07:52 -05:00
Kyle Edwards
e62a3b8625 Help/export: Add signature directives 2023-11-13 11:07:52 -05:00
Brad King
92cc1f3b62 Merge topic 'Ninja-use-depslog'
bb7a0497ef cmTransformDepfile: warn when a depfile is not written to
c22c473bde Tests/Ninja*/CustomCommandDepfile: check that deps are in the database
b0177003e1 cmGlobalNinjaGenerator: tell `ninja` to actually read the depfile
45eff9145e cmAddCustomCommandCommand: use `cmStrCat`
c6445c615b Tests/RunCMake/Ninja: fix subdir prefix check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8911
2023-11-07 09:07:46 -05:00
Ben Boeckel
b0177003e1 cmGlobalNinjaGenerator: tell ninja to actually read the depfile
But only do so if the depfile is not specified as an output of the
command. Otherwise the command will out-of-date itself as `ninja`
deletes depfiles that it incorporates into the database and a missing
output will cause the command to run again.
2023-11-01 14:08:18 -04:00
Marc Chevrier
337bc5662c if(): add operators IS_READABLE, IS_WRITABLE and IS_EXECUTABLE.
Offers possibility to check for file or directory permissions.
2023-11-01 14:53:31 +01:00
Brad King
54e06c601d Help: Replace link with its http redirect 2023-10-19 09:24:41 -04:00
Brad King
dd78592ba1 Merge topic 'try_compile-alias-targets'
8f9f371668 try_compile: Add support for using ALIAS targets
9f8aa94192 Add missing `OUTPUT` in ExportImport test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8877
2023-10-17 10:22:54 -04:00
Cristian Le
8f9f371668 try_compile: Add support for using ALIAS targets
Fixes: #25337
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-10-16 20:22:23 +02:00
scivision
0f37000304 try_{compile,run}: add LINKER_LANGUAGE option
Fixes: #25326
2023-10-16 11:30:17 -04:00
Ben Boeckel
0c07f39006 cmExperimental: remove the flag for C++ modules
All the major compilers now have scheduled releases with support for
scanning, so remove the experimental gate.

Fixes: #18355
2023-10-02 10:17:31 -04:00
Brad King
f83790af0b Merge topic 'fileset-private-dep'
ec2ba29ac5 Ninja: Allow compilation before generation of dependencies' private sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8420
2023-09-21 09:39:56 -04:00
Brad King
51c2927816 Help: Clarify requirements for find_package to use lib{64,32,x32} paths
Issue: #25157
2023-09-20 12:44:00 -04:00
Brad King
e625255fe4 Help: Indent find_package REGISTRY_VIEW paragraphs together
In commit 8d7e80cf3d (find_* commands: add control over Windows registry
views, 2022-04-16, v3.24.0-rc1~201^2) this indentation was used for the
other find commands but was left out for `find_package`.
2023-09-20 12:31:27 -04:00
Martin Duffy
ec2ba29ac5 Ninja: Allow compilation before generation of dependencies' private sources
This requires knowing when a generated header is public, which we can
model using file sets.  Add policy CMP0154 to treat generated sources
as private by default in targets with file sets.  Generated public
headers can be specified in public file sets.

Fixes: #24959
Issue: #15555
2023-09-20 10:25:24 -04:00
Brad King
0a81110b84 find_(library|file|path): Drop PATH-derived search prefixes
Since commit ffc06c1239 (Teach find_(library|file|path) to get prefixes
from PATH, 2015-02-18, v3.3.0-rc1~430^2) we search in `<prefix>/include`
and `<prefix>/lib` directories for prefixes with `bin` directories in
the `PATH` environment variable.  The motivation was to search the
installation prefixes of MSYS and MinGW development environments
automatically.

This behavior can search undesired prefixes that happen to be in the
`PATH` for unrelated reasons.  It was reverted for non-Windows hosts
within a year by commit b30b32a493 (Drop find_(library|file|path)
prefixes from PATH on non-Windows, 2016-05-09, v3.6.0-rc1~82^2) but was
kept on Windows hosts to support its motivating use case.  However,
similar problems have since been observed on Windows.  For example,
commit 955d6245c1 (MSVC: Revert "Teach find_library to consider the
'libfoo.a' naming convention", 2022-11-28, v3.25.1~6^2) was primarily
due to undesired discovery of libraries in `PATH`-derived prefixes.

Since commit 5e5132e1b1 (MinGW: Search for packages in standard MSYSTEM
environment prefixes, 2023-09-11) we search MSYS and MinGW environments'
prefixes explicitly, so `PATH`-derived prefixes are no longer needed for
the original motivating use case.

Fixes: #24216
2023-09-14 15:13:50 -04:00
Brad King
a273b7f5d4 Merge topic 'host-msystem-prefix'
84a25fc263 cmake_host_system_information: Add MSYSTEM_PREFIX query
cdcff0a0f0 cmCMakeHostSystemInformationCommand: Clarify function names and roles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8788
2023-09-11 12:27:37 -04:00
Brad King
84a25fc263 cmake_host_system_information: Add MSYSTEM_PREFIX query
Add a query on Windows hosts for the installation prefix of a
MSYS or MinGW development environment.

Issue: #24216
2023-09-10 07:33:47 -04:00
Brad King
5924a1f0eb Help: Document if() comparison number format
Fixes: #25237
2023-09-08 10:26:34 -04:00
FeRD (Frank Dana)
bbf3ed5422 Help: Explain block() policy-scope rules more clearly 2023-09-01 21:28:56 +10:00
FeRD (Frank Dana)
2f319c6484 Help: Remove "this command" ambiguity in set() docs 2023-09-01 21:28:56 +10:00
FeRD (Frank Dana)
9eecdc7ab7 Help: Use signature directive for cmake_policy() 2023-09-01 21:28:40 +10:00