Commit Graph

1629 Commits

Author SHA1 Message Date
Brad King
3c4afba8cc Remove compatibility with CMake versions older than 2.8.12
This compatibility has been deprecated since commit 5845c218d7
(Deprecate compatibility with CMake versions older than 2.8.12,
2020-06-12, v3.19.0-rc1~629^2).  The behavior itself has been
deprecated since CMake 2.8.12.

Issue: #26613
2025-01-18 09:51:45 -05:00
Brad King
785523a136 Remove compatibility with CMake versions older than 2.8.0
This compatibility has been deprecated since commit 5845c218d7
(Deprecate compatibility with CMake versions older than 2.8.12,
2020-06-12, v3.19.0-rc1~629^2).  The behavior itself has been
deprecated since CMake 2.8.0.

Issue: #26613
2025-01-17 09:36:10 -05:00
Brad King
bd176b430c Renumber post-3.31 development from 3.32 to 4.0
Issue: #26613
2025-01-16 09:18:21 -05:00
Brad King
1d5c1b0023 Merge topic 'policy-cleanup'
b010a1fb1d Help: Update try_compile list of automatic policies
5e9b40b6a5 Help: Update cmake-buildsystem(7) TARGET_POLICY example to a newer policy
9ffbc0e628 Tests/RunCMake/cmake_minimum_required: Generalize deprecated version case name
0eca249ac7 Tests/RunCMake: Update more cmake_minimum_required versions to 3.10
a8cf033a74 Tests/RunCMake/return: Use newer cmake_minimum_required VERSION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10178
2025-01-16 09:01:48 -05:00
Brad King
e87c6c6259 Merge topic 'execute-process-error'
3ece058d97 execute_process: Allow setting default COMMAND_ERROR_IS_FATAL value
85035dd954 Help/command/execute_process: Fix definition list formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10169
2025-01-16 08:59:00 -05:00
Brad King
8018f2a6c4 Merge topic 'instrumentation'
097d4fd1b5 instrumentation: Collect and record project build system metrics
8a3c195188 Tests/RunCMake: Add RunCMake_CHECK_ONLY Option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !9791
2025-01-16 08:55:25 -05:00
Brad King
b010a1fb1d Help: Update try_compile list of automatic policies 2025-01-15 11:21:21 -05:00
Martin Duffy
3ece058d97 execute_process: Allow setting default COMMAND_ERROR_IS_FATAL value
Issue: #26576
2025-01-15 11:12:34 -05:00
Martin Duffy
097d4fd1b5 instrumentation: Collect and record project build system metrics
Add a feature for collecting build instrumentation for CMake projects.

Issue: #26099
2025-01-15 09:16:50 -05:00
Brad King
85035dd954 Help/command/execute_process: Fix definition list formatting 2025-01-13 13:34:15 -05:00
Peter Kokot
d7b33ed8e2
file(MAKE_DIRECTORY): Update synopsis signature
This syncs the signature as it provides another optional option.
2025-01-07 02:15:33 +01:00
scivision
9be6e42499 Help: Note try_compile/try_run caching 2024-12-18 10:04:47 -05:00
Brad King
135e6feba9 Merge topic 'find-cps'
d00201afd6 Tests: Add tests for CPS find_package
65429611b9 find_package: Fix handling of relative paths in CPS
5236984a08 Help: Describe CPS support in find_package
34828650d6 find_package: Add experimental gate for CPS support
25cc83428e find_package: Actually import .cps files
91c31ada23 find_package: Actually find .cps files
b89e43b2bc find_package: Start implementing CPS search
3e9f96079d Add additional string case functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10018
2024-12-17 10:12:24 -05:00
Brad King
ef1300749c Merge topic 'ci-linkcheck'
25b25a7724 Help: Update link to UTF-8 RFC 3629

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10103
2024-12-17 10:07:47 -05:00
Brad King
25b25a7724 Help: Update link to UTF-8 RFC 3629
The old link now returns 404.
2024-12-16 09:20:23 -05:00
Brad King
987f3fa4e0 Help: Add cmake-buildsystem(7) subsections for each binary target type
Re-organize the "Binary Targets" section of the manual to have a
dedicated subsection for each kind of binary target.  Initialize each
subsection by documenting the object file and link semantics of the
corresponding target type.
2024-12-13 09:53:26 -05:00
Matthew Woehlke
5236984a08 Help: Describe CPS support in find_package
Update find_package documentation to describe (the current state of)
support for Common Package Specification packages. Make some general
improvements to the same while we're at it. Add documentation blurb for
the experimental flag that enables CPS support.
2024-12-13 08:58:24 -05:00
Matthew Woehlke
b89e43b2bc find_package: Start implementing CPS search
Teach find_package to search CPS search paths, and to look for CPS file
names. Modify the set of file names to also include the file type (CPS
or CMake-script). Modify the search function to allow specifying which
file type(s) to consider.

During full path search, each possible path is searched for only one of
the two possible file types. However, subsequent runs, or when
considering a user-specified path (<name>_DIR), CMake will look for both
file types.

Note that this only adds the new path search logic as described above;
CMake does not yet know how to read CPS files, and there is a high
likelihood that Bad Things will happen if it tries. However, this seemed
like a good place to checkpoint.
2024-12-13 08:58:24 -05:00
SunBlack
041537e5ce Help: Clarify find_package version range limitation
Issue: #26470
2024-11-26 09:25:15 -05:00
Brad King
242702803f Merge topic 'doc-if-path'
3530eef3fb Help: Clarify that if(PATH_EQUAL) does not access the filesystem

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !10001
2024-11-20 09:25:29 -05:00
scivision
3530eef3fb Help: Clarify that if(PATH_EQUAL) does not access the filesystem
Fixes: #26421
2024-11-19 12:01:03 -05:00
Craig Scott
30f596f417 Merge topic 'cmp0175-restore-USES_TERMINAL-for-TARGET-form'
62586f236c CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10005
2024-11-16 16:16:48 -05:00
Craig Scott
62586f236c
CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)
Fixes: #26449
2024-11-16 10:02:01 +11:00
Marc Chevrier
35350c419d Add support of "LINKER:" prefix for CMAKE_<TYPE>_LINKER_FLAGS variable
The following variables now support the LINKER: prefix:
* CMAKE_<TYPE>_LINKER_FLAGS
* CMAKE_<TYPE>_LINKER_FLAGS_<CONFIG>

Fixes: #26171
2024-11-04 17:07:58 +01:00
Brad King
e83535f5a3 Merge topic 'improve-package-search'
6f3dc1161a find_package: Also sort Framework matches
e90f60f864 find_package: Don't glob certain macOS paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9942
2024-10-25 08:25:34 -04:00
Brad King
0ba8bdb5c2 Merge topic 'doc-BUILD_TESTING'
9510820d58 Help: Document CTest module BUILD_TESTING variable
6e6e688b80 CTest: Improve formatting of documentation cmake code blocks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9927
2024-10-25 08:23:25 -04:00
Matthew Woehlke
6f3dc1161a find_package: Also sort Framework matches
Add cmAnyDirectoryListGenerator, which matches any directory but also
sorts matches in the same manner as cmProjectDirectoryListGenerator.
Modify SearchFrameworkPrefix to use this, in combination with a literal
path (cmAppendPathSegmentGenerator), instead of cmFileListGeneratorGlob
(which is removed, as it is no longer used). This improves the
consistency of when sorting is available.

This uses cmDirectoryListGenerator's new ability to match anything, as
mentioned in the previous commit.
2024-10-24 13:42:42 -04:00
Robert Maynard
9510820d58 Help: Document CTest module BUILD_TESTING variable
The `BUILD_TESTING` variable is referenced in `add_test` and
`enable_testing`.  It should be documented as it controls the
behavior tests working when projects use `include(CTest)`.
2024-10-24 11:46:37 -04:00
Brad King
3ef7198e43 Merge topic 'fix-path-search-doc'
630e4a12a3 Help: Fix find_package search order w.r.t. globs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Matthew Woehlke <matthew.woehlke@kitware.com>
Merge-request: !9930
2024-10-24 08:59:43 -04:00
Matthew Woehlke
630e4a12a3 Help: Fix find_package search order w.r.t. globs
Add documentation to clarify that `find_package` searches paths in the
specified order and stops at the first match.  Clarify documentation of
`CMAKE_FIND_PACKAGE_SORT_*` to match the actual behavior.

Note that no behavior is actually changed, this merely improves the
documentation to reflect actual behavior rather than seeming to imply
something else.

Also, update the test to verify that what we claim in the updated
documentation is what's actually happening.
2024-10-23 12:46:07 -04:00
Brad King
9b2fcb7779 Merge topic 'LINKER-prefix-support-for-libraries'
aba1c9d172 target_link_libraries: Add support for the LINKER: prefix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9882
2024-10-12 10:30:12 -04:00
Marc Chevrier
aba1c9d172 target_link_libraries: Add support for the LINKER: prefix
It is now possible to use the `LINKER:` prefix in `LINK_LIBRARIES`
and `INTERFACE_LINK_LIBRARIES` target properties.

Fixes: #26318
2024-10-11 17:54:02 +02:00
Daniel Pfeifer
267b42bccc CTest: Remove declarative scripting mode 2024-10-09 22:30:58 +02:00
Brad King
aa6bbc3135 Help: Update Sphinx versionadded directives for 3.31 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.30.0 --overwrite
2024-10-09 09:32:54 -04:00
Craig Scott
e5a9ccbcc8 project: Always set <PROJECT-NAME>_* as normal variables
Re-introduce the behavior originally introduced in CMake 3.30.3 by
commit c1ece78d11 (project: non cache <project> prefix variables are
also created, 2024-08-27, v3.30.3~2^2), but this time with a policy for
compatibility.

Issue: #25714
Issue: #26243
2024-10-08 10:07:11 -04:00
Brad King
dc371e07fb Merge topic 'project-vars'
fa07ddfebf project: Only check non-cache vars when setting project vars

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9883
2024-10-08 08:45:26 -04:00
Craig Scott
fa07ddfebf project: Only check non-cache vars when setting project vars
The change in commit 86ad7cc886 (project: Only define non-cache vars if
already defined, 2024-09-15, v3.30.4~2^2) was meant to only check for
non-cache variables when deciding whether to set non-cache project
variables for the current call.  However, it erroneously checked for any
variable, including cache variables.  This gives the intended result on
the first run, but on subsequent runs a cache variable will exist that
did not on the first run, leading to different behavior between the two
runs.  Fix the logic to only check for a pre-existing non-cache
variable, as was originally intended.

Fixes: #26355
2024-10-07 10:24:37 -04:00
Brad King
84db8506ff Deprecate compatibility with CMake versions older than 3.10
Issue a deprecation warning on calls to `cmake_minimum_required` or
`cmake_policy` that set policies based on versions older than 3.10.
Note that the effective policy version includes `...<max>` treatment.
Update the check from commit 3a4791548d (Deprecate compatibility with
CMake versions older than 3.5, 2023-02-09, v3.27.0-rc1~508^2).
2024-10-03 14:18:26 -04:00
scivision
7a88ca2e56 Help: Document find_program filename suffix behavior
Issue: #16453
2024-10-03 08:00:41 -04:00
Brad King
f7e2422c3e Merge topic 'curl-tls-version'
38390245a2 ctest: Require minimum TLS 1.2 by default
5e1a59dc2b file(DOWNLOAD/UPLOAD): Require minimum TLS 1.2 by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9848
2024-09-27 08:03:01 -04:00
Brad King
5e1a59dc2b file(DOWNLOAD/UPLOAD): Require minimum TLS 1.2 by default
Fixes: #25701
2024-09-26 10:10:20 -04:00
Brad King
53f3e5da1e Merge topic 'link-strategy'
7abd3137b7 Linking: Optionally reorder direct dependencies from LINK_LIBRARIES
9285a9dc9a cmComputeLinkDepends: Add final dependency ordering to debug output
f792db4ca2 cmComputeLinkDepends: Add undocumented per-target debug property
80b469a51d cmComputeLinkDepends: Factor out string literals as named constants
3bd73fcc76 cmComputeLinkDepends: Modernize member initialization
8db69c767b cmComputeLinkDepends: Remove redundant member
dccdd030cd cmComputeLinkDepends: Replace depender index sentinel value with cm::optional
6c9d8dc243 cmComputeLinkDepends: Replace group index sentinel value with cm::optional
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9835
2024-09-26 08:47:47 -04:00
Brad King
6b7e634b7c Help: Explicitly state include_external_msproject is only for VS generators
Fixes: #19975
2024-09-25 07:24:32 -04:00
Brad King
7abd3137b7 Linking: Optionally reorder direct dependencies from LINK_LIBRARIES
Traditionally CMake generates link lines by starting with the direct
link dependencies specified by `LINK_LIBRARIES` in their original order
and then appending indirect dependencies that the direct dependencies
do not express.  This gives projects control over ordering among
independent entries, which can be important when intermixing flags
and libraries, or when multiple libraries provide the same symbol.
However, it may also result in inefficient link lines.

Add support for an alternative strategy that can reorder direct link
dependencies to produce more efficient link lines.  This is useful
for projects that cannot easily specify their targets' direct
dependencies in an order that satisfies indirect dependencies.

Add a `CMAKE_LINK_LIBRARIES_STRATEGY` variable and corresponding
`LINK_LIBRARIES_STRATEGY` target property to select a strategy.

Fixes: #26271
2024-09-25 06:48:57 -04:00
Brad King
ea3405ff60 Merge topic 'curl-tls-verify'
4e62bc943c ctest: Verify TLS server certificate by default
8e92ee34f6 file(DOWNLOAD/UPLOAD): Verify TLS server certificate by default
dcaea54898 cmCTestCurl: Clarify names and logic using optional<bool>
03d37ae3ff cmFileCommand: Clarify names and logic using optional<bool>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9843
2024-09-24 10:35:19 -04:00
Brad King
8e92ee34f6 file(DOWNLOAD/UPLOAD): Verify TLS server certificate by default
If the connection fails in a way that might be a certificate error, and
verification was enabled by the new default, mention environment
variable `CMAKE_TLS_VERIFY` in the diagnostic to help users that were
relying on the old behavior turn off server certificate verification in
their environment.

Fixes: #23608
2024-09-24 08:37:23 -04:00
Brad King
c5f7e3bc3b Merge branch 'backport-project-vars' into project-vars 2024-09-20 10:35:02 -04:00
Craig Scott
86ad7cc886 project: Only define non-cache vars if already defined
In c1ece78d11 (project: non cache <project> prefix variables are
also created, 2024-08-27), we started explicitly setting the non-cache
variable for <projectName>_SOURCE_DIR, <projectName>_BINARY_DIR,
and <projectName>_IS_TOP_LEVEL in addition to setting them as
cache variables. This changed the behavior when a project name
was used more than once, and the second project call happens in
the same scope or a child scope of the first. Previously, the first
project call would set cache variables, and the second project call
would not overwrite those cache variables. With the change in
c1ece78d11, after the second project call the non-cache variables
would mask the cache variables and the project code would see
a different value to what it did before.

Setting the non-cache variable was added to handle the case where
a call to FetchContent_MakeAvailable() would set some non-cache
variables, and it just so happened those matched the same cache
variables that the project() command would set in the project being
fetched. The fetched project would then see a different set of
project-specific variables compared to when it was built standalone.

This commit here narrows the change from c1ece78d11 such that
the non-cache variable is only set by project() if there was already
a non-cache variable set. This still fixes the motivating problem
c1ece78d11 was intended to solve, but it avoids changing the variable
values seen by a project that re-uses the same project name in related scopes.

Issue: #26243, #25714
Fixes: #26281
2024-09-20 10:33:25 -04:00
Craig Scott
4c152752da Help: State valid scopes for using proj_SOURCE_DIR and proj_BINARY_DIR
Issue: #25714
2024-09-20 10:33:25 -04:00
Brad King
fdceee50e6 Merge topic 'normalize-install-destination-paths'
6a1fac1450 install: Normalize DESTINATION paths
2184fcfb00 Tests: Configure RunCMake.install cases with correct build type
5a8a6dfe81 cmGeneratorExpression: Change Find() parameter type to cm::string_view
d810374b3d install(PACKAGE_INFO): Remove outdated TODO comment
d13ed01d54 Tests: Remove unused files from RunCMake.install

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9800
2024-09-20 10:27:30 -04:00
Craig Scott
6a1fac1450
install: Normalize DESTINATION paths
The file generated by install(EXPORT) computes _IMPORT_PREFIX
in a way that assumes a normalized path. If the DESTINATION
contains any ../ components, the computed _IMPORT_PREFIX
would be wrong. Force the DESTINATION path to be normalized,
subject to the new CMP0176 policy.

Also normalize all other DESTINATION paths for consistency,
except for INCLUDES DESTINATION, which is not strictly a
destination but rather a search path to add.

Fixes: #26252
2024-09-19 20:31:47 +10:00
Chen Linxuan
39603a7e5c install: Add TYPE LIBEXEC for FILES and DIRECTORY
Signed-off-by: Chen Linxuan <me@black-desk.cn>
2024-09-18 11:05:28 -04:00
Brad King
e782811cfe execute_process: Change default ENCODING to UTF-8
Windows is heading toward making UTF-8 the preferred MBCS.  As CMake's
internal encoding, `UTF-8` is effectively equivalent to `NONE`, which
was CMake's behavior prior to 3.15's accidental change to `AUTO`.
Behavior of `ENCODING UTF-8` is independent of CMake's internal
encoding, making it in principle a better default than `NONE`.

Add policy CMP0176 for compatibility and to document the default's
history.

Fixes: #26262
2024-09-16 06:37:46 -04:00
Brad King
3898e53e82 execute_process: Document and test ENCODING default
The default was originally AUTO in commit 2ed473b3b8 (execute_process:
Add ENCODING option for Windows child process output, 2016-11-23,
v3.8.0-rc1~232^2) but was changed back to NONE by commit 07c3380a6e
(execute_process: Restore no-decoding default behavior, 2017-02-13,
v3.8.0-rc2~26^2) for CMake 3.8.  Later it was accidentally changed back
to AUTO by commit b783e62533 (cmExecuteProcessCommand: Port to
cmArgumentParser, 2019-03-25, v3.15.0-rc1~270^2) in CMake 3.15 but the
documentation was not updated.  Document the current default, AUTO, and
add a test case to verify it.

Issue: #26262
2024-09-13 08:19:57 -04:00
Brad King
d67519fce8 Help/command/execute_process: Improve formatting of ENCODING names 2024-09-13 08:19:35 -04:00
Brad King
b91ea1b368 Merge topic 'file-archive-workdir'
d8a9aabd24 file(ARCHIVE_CREATE): add WORKING_DIRECTORY option
d65b5a8e03 Help: Format file(ARCHIVE*) options as definition lists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9803
2024-09-12 08:10:54 -04:00
Yuri Witte
d8a9aabd24 file(ARCHIVE_CREATE): add WORKING_DIRECTORY option
Fixes: #25260
Issue: #21653
2024-09-11 09:52:32 -04:00
Brad King
d65b5a8e03 Help: Format file(ARCHIVE*) options as definition lists 2024-09-11 09:50:55 -04:00
Brad King
dd023d9707 Merge topic 'add_custom_command-arg-handling'
ec519f3e97 add_custom_command: Validate arguments more rigorously
8dc8be0884 AndroidTestUtilities: Remove DEPENDS that was being silently ignored
316840b430 Tests: Add missing POST_BUILD to custom commands
f5f80305ef ExternalProject: Ensure keywords requiring an argument have one

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9785
2024-09-11 09:32:24 -04:00
Craig Scott
ec519f3e97
add_custom_command: Validate arguments more rigorously
Add a new CMP0175 policy to preserve backward compatibility
for projects that were using unsupported keywords or arguments.

Fixes: #26096, #21089, #18976
2024-09-10 08:19:09 +10:00
Craig Scott
012d116260 Merge topic 'cmp0168-populate-nondeclare-regression'
cbb727ca6b FetchContent: Don't update verify script timestamp if it doesn't change
795e7b44f2 Help: file(CONFIGURE) only updates output file timestamp if it changes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9799
2024-09-08 18:32:40 -04:00
Craig Scott
795e7b44f2
Help: file(CONFIGURE) only updates output file timestamp if it changes 2024-09-06 15:48:38 +10:00
Craig Scott
2000abe74f
Help: Recommend good prefixes for cmake_parse_arguments, expand example
Fixes: #25773
2024-08-31 18:33:14 +10:00
Craig Scott
bb37d0e1a5
Help: Improve grammar and wording for cmake_parse_arguments 2024-08-31 18:10:32 +10:00
Brad King
241f923a6f Drop Visual Studio 12 2013 generator
This generator has been deprecated since CMake 3.28.  Remove it.
2024-08-28 14:13:05 -04:00
Brad King
cb2467d69a Merge topic 'if-space-dldt'
2c0d16df7b Help/command/if: fix formatting in precedence order overview

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9777
2024-08-28 10:04:04 -04:00
Brad King
72607d3402 Merge topic 'cps-export'
b2dc1bd149 CMake: Suppress IBM XL optimization warning
1a846c8849 Tests: Add tests for install(PACKAGE_INFO)
3d52d70b84 export: Add initial CPS support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9693
2024-08-27 09:43:51 -04:00
Aleksei Shpakovskii
2c0d16df7b Help/command/if: fix formatting in precedence order overview
Due to extra space symbols, it was rendered as definition list inside
list item, instead of plain list item.
2024-08-27 14:07:58 +02:00
Brad King
d625e832ed Merge topic 'cmake-parse-arguments-one-arg-empty-string'
ceeea4e511 cmake_parse_arguments: Set variable if empty string given after keyword
2f5cc6afa1 cmParseArgumentsCommand: Use cmStrCat() for string concatenation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9748
2024-08-26 09:53:16 -04:00
Craig Scott
d48834d277 Merge topic 'doc-get_property-undefined'
a1fdcb9d47 Help: get_property() result var is unset if property is not set
edee1b18b2 Help: Minor formatting and grammar fixes for get_property()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9769
2024-08-23 19:16:03 -04:00
Craig Scott
a1fdcb9d47
Help: get_property() result var is unset if property is not set
Fixes: #26152
2024-08-23 09:58:46 +10:00
Craig Scott
edee1b18b2
Help: Minor formatting and grammar fixes for get_property() 2024-08-23 09:57:14 +10:00
Craig Scott
ceeea4e511
cmake_parse_arguments: Set variable if empty string given after keyword
If a single-value keyword is followed by an empty string, the
command unsets the variable for that keyword instead of setting
it to the empty string. This is inconsistent and unexpected. Add
policy CMP0174 which ensures the variable for a single-value
keyword is always set when any value is given, not just for a
non-empty value.

The new CMP0174 policy only affects the PARSE_ARGV form of
cmake_parse_arguments. The older form silently drops all empty
string arguments before processing the argument list.

Fixes: #25972
2024-08-23 09:42:13 +10:00
Aleksei Shpakovskii
2e634501fd Help/command/if: list all condition operators in precedence order overview
This section is near the top and so can serve as an exhaustive
table of contents for the things that `if()` can check.
2024-08-22 11:31:12 -04:00
Brad King
e4a359e5d4 Help/command/if: Document variable expansion by IN_LIST
Previously this behavior was only mentioned implicitly by the command
signature.  Describe it explicitly as we do for other conditions that
automatically expand variables.

Fixes: #26234
2024-08-21 09:17:21 -04:00
Brad King
89d7ed5497 Merge topic 'fix-dependencies-searching'
4d4e008e69 file(GET_RUNTIME_DEPENDENCIES): Fix resolution of repeated ELF dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9704
2024-08-20 11:38:27 -04:00
Aliaksandr Averchanka
4d4e008e69 file(GET_RUNTIME_DEPENDENCIES): Fix resolution of repeated ELF dependencies
When a library file name is encountered multiple times, reuse the result
from the first time.  This more closely matches the behavior of the
dynamic loader on Linux.

Fixes: #24621
2024-08-19 08:57:04 +03:00
Craig Scott
13bf4dc9ef
Help: State valid scopes for using proj_SOURCE_DIR and proj_BINARY_DIR
Fixes: #25714
2024-08-17 16:11:22 +10:00
Matthew Woehlke
3d52d70b84 export: Add initial CPS support
Add initial support for exporting (install only, for now) Common Package
Specification (https://cps-org.github.io/cps/) format package
descriptions. This has some limitations, such as not supporting
generator expressions (as these cannot be portably exported), and only
partially supporting transitive dependencies, but should be usable for
at least some simple cases. (Actually, $<LINK_ONLY> is theoretically
supportable, but is not yet implemented.)

This still needs tests; these will be added in the next commit. Other
potential improvements include support for language-specific compile
definitions and inferring some package properties from project
properties. Additionally, there is no module support yet; this is partly
pending on having a tool agnostic format for providing the necessary
information.
2024-08-14 15:25:27 -04:00
FeRD (Frank Dana)
38aae609df Help(install): Move RENAME docs to FILES signature
The document's intro claims that the options documented up top are
the ones common to multiple signatures, but `RENAME` is only valid
for `install(FILES ...)`. Move it to that section of the docs.
2024-08-01 12:41:43 -04:00
Vito Gamberini
8555c33d92
PkgC: Add cmake_pkg_config(EXTRACT) command
* Wraps the llpkgc parser with cmPkgConfigParser
* Adds various resolution and mangling code under cmPkgConfigResolver
* Documents new command cmake_pkg_config(EXTRACT). Documentation is written with
  the assumption additional subcommands will be added soon.
* Adds various tests for the above
2024-07-29 13:14:46 -04:00
Brad King
b0ba99f152 Merge topic 'doc-add_test-typo'
ca39258a66 Help: Fix typo in add_test documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9687
2024-07-29 10:59:00 -04:00
Brad King
ca39258a66 Help: Fix typo in add_test documentation 2024-07-26 10:37:35 -04:00
Martin Duffy
159ba027b9 Install: Add parallel installation option
Fixes: #26000
2024-07-15 11:49:29 -04:00
Juan Ramos
197cb419d1 add_custom_command: Add CODEGEN support
By specifying CODEGEN as an argument to add_custom_command the
custom command will be added to a codegen build target.

The intent is to provide a convenient way for users to get
their generated files without having to build the whole project.

This can be helpful for code analysis tools which can be useful
for IDEs and CI.
2024-07-01 12:02:49 -04:00
Asit Dhal
95323c90a1 file(MAKE_DIRECTORY): Add optional RESULT keyword to capture failure.
Fixes: #26041
2024-06-24 02:20:43 +02:00
Brad King
60da7cb84e Merge topic 'doc-add_subdirectory-EXCLUDE_FROM_ALL'
2449c04d8d Help: improve docs for the EXCLUDE_FROM_ALL directory property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9497
2024-06-06 08:41:59 -04:00
Brad King
97328b05c3 Merge topic 'doc-add_subdirectory-EXCLUDE_FROM_ALL' into release-3.30
2449c04d8d Help: improve docs for the EXCLUDE_FROM_ALL directory property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9497
2024-06-06 08:41:58 -04:00
Alex Neundorf
2449c04d8d Help: improve docs for the EXCLUDE_FROM_ALL directory property
This patch improves the wording of the documentation of the
EXCLUDE_FROM_ALL directory property, and makes the
add_subdirectory()- and fetchcontent-documentation refer to it.
2024-06-04 16:58:54 +02:00
Brad King
d1cf2a2206 Merge topic 'file-accept-empty-lists'
7c516f7e28 file(): TOUCH, TOUCH_NOCREATE and MAKE_DIRECTORY accept empty lists

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9570
2024-06-03 09:08:52 -04:00
Craig Scott
422ab50a8e Merge topic 'doc-find_package-typical-usage'
4b55d56259 Help: Start find_package() docs with a new "Typical Usage" section

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9567
2024-06-01 18:25:18 -04:00
Brad King
e0a11dfa24 Merge topic 'dep-provider-try_compile'
4cb5bb014d try_compile: Propagating top level includes into whole-project calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9532
2024-05-31 09:20:27 -04:00
Craig Scott
7c516f7e28
file(): TOUCH, TOUCH_NOCREATE and MAKE_DIRECTORY accept empty lists
Projects may be generating a list of files or directories to pass as arguments
to file(TOUCH), file(TOUCH_NOCREATE), or file(MAKE_DIRECTORY). Those
lists might end up being empty, so rather than requiring at least one item,
allow an empty list.

Fixes: #24897
2024-05-31 22:55:20 +10:00
Craig Scott
4b55d56259
Help: Start find_package() docs with a new "Typical Usage" section
Fixes: #22680
2024-05-31 16:05:23 +10:00
Craig Scott
4cb5bb014d
try_compile: Propagating top level includes into whole-project calls
Fixes: #24151
2024-05-30 19:01:03 +10:00
Brad King
645ca62b1b Merge topic 'doc-macro'
67171a99be Help: Fix inaccurate use of "function" in macro docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Juan Ramos <juan.ramos@kitware.com>
Merge-request: !9534
2024-05-21 09:17:17 -04:00
Dave Abrahams
67171a99be Help: Fix inaccurate use of "function" in macro docs 2024-05-21 09:13:57 -04:00
Brad King
d37467e036 Merge topic 'custom-command-output-hash-character'
8d2a503c1e add_custom_command: Allow OUTPUT filenames containing a hash '#' character
b38000d774 cmGlobalXCodeGenerator: Re-implement legacy makefile path escaping
d929089687 cmGlobalXCodeGenerator: Do not use legacy makefile escaping in shell commands
d61fc2c52e cmGlobalXCodeGenerator: Migrate legacy makefile path escaping to local helper
6010e007c7 cmState: Add method to check for the Borland Makefiles generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9514
2024-05-16 11:24:56 -04:00
Glenn Coombs
8d2a503c1e add_custom_command: Allow OUTPUT filenames containing a hash '#' character
Most generators now support this character after escaping and quoting
cleanups over time.  Disallow it only on generators that do support it.

Fixes: #25604
2024-05-15 13:27:46 -04:00
scivision
fc2bce54c7
Help: try_compile how to pass compiler options
it wasn't obvious how to pass compiler options. Since the old
add_definitions() is used we can workaround this by passing
compiler options there.
2024-05-11 22:57:38 -04:00