summaryrefslogtreecommitdiffstats
path: root/Help/command
Commit message (Collapse)AuthorAgeFilesLines
* Help: Update link to UTF-8 RFC 3629Brad King2024-12-161-1/+2
| | | | The old link now returns 404.
* CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)Craig Scott2024-11-151-1/+2
| | | | Fixes: #26449
* Help: Fix find_package search order w.r.t. globsMatthew Woehlke2024-10-231-16/+36
| | | | | | | | | | | | | 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.
* Help: Update Sphinx versionadded directives for 3.31 releaseBrad King2024-10-091-0/+2
| | | | | | Run the script: Utilities/Sphinx/update_versions.py --since v3.30.0 --overwrite
* project: Always set <PROJECT-NAME>_* as normal variablesCraig Scott2024-10-081-20/+11
| | | | | | | | | | 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
* Merge topic 'project-vars'Brad King2024-10-081-4/+20
|\ | | | | | | | | | | | | | | 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
| * project: Only check non-cache vars when setting project varsCraig Scott2024-10-071-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Deprecate compatibility with CMake versions older than 3.10Brad King2024-10-031-0/+8
| | | | | | | | | | | | | | | | 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).
* | Help: Document find_program filename suffix behaviorscivision2024-10-031-0/+20
| | | | | | | | Issue: #16453
* | Merge topic 'curl-tls-version'Brad King2024-09-271-0/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | file(DOWNLOAD/UPLOAD): Require minimum TLS 1.2 by defaultBrad King2024-09-261-0/+4
| | | | | | | | | | | | Fixes: #25701
* | | Merge topic 'link-strategy'Brad King2024-09-261-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Linking: Optionally reorder direct dependencies from LINK_LIBRARIESBrad King2024-09-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Help: Explicitly state include_external_msproject is only for VS generatorsBrad King2024-09-251-4/+5
| |/ / |/| | | | | | | | Fixes: #19975
* | | Merge topic 'curl-tls-verify'Brad King2024-09-241-5/+10
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | file(DOWNLOAD/UPLOAD): Verify TLS server certificate by defaultBrad King2024-09-241-5/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'backport-project-vars' into project-varsBrad King2024-09-201-0/+6
|\ \ \ | |/ / |/| / | |/
| * project: Only define non-cache vars if already definedCraig Scott2024-09-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Help: State valid scopes for using proj_SOURCE_DIR and proj_BINARY_DIRCraig Scott2024-09-201-2/+9
| | | | | | | | Issue: #25714
* | Merge topic 'normalize-install-destination-paths'Brad King2024-09-201-1/+13
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | install: Normalize DESTINATION pathsCraig Scott2024-09-191-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | install: Add TYPE LIBEXEC for FILES and DIRECTORYChen Linxuan2024-09-181-0/+8
|/ / | | | | | | Signed-off-by: Chen Linxuan <me@black-desk.cn>
* | execute_process: Change default ENCODING to UTF-8Brad King2024-09-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | execute_process: Document and test ENCODING defaultBrad King2024-09-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Help/command/execute_process: Improve formatting of ENCODING namesBrad King2024-09-131-4/+11
| |
* | Merge topic 'file-archive-workdir'Brad King2024-09-121-35/+58
|\ \ | | | | | | | | | | | | | | | | | | | | | 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
| * | file(ARCHIVE_CREATE): add WORKING_DIRECTORY optionYuri Witte2024-09-111-0/+9
| | | | | | | | | | | | | | | Fixes: #25260 Issue: #21653
| * | Help: Format file(ARCHIVE*) options as definition listsBrad King2024-09-111-36/+50
| | |
* | | Merge topic 'add_custom_command-arg-handling'Brad King2024-09-111-9/+60
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | add_custom_command: Validate arguments more rigorouslyCraig Scott2024-09-091-9/+60
| | | | | | | | | | | | | | | | | | | | | Add a new CMP0175 policy to preserve backward compatibility for projects that were using unsupported keywords or arguments. Fixes: #26096, #21089, #18976
* | | Merge topic 'cmp0168-populate-nondeclare-regression'Craig Scott2024-09-081-1/+3
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 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
| * | Help: file(CONFIGURE) only updates output file timestamp if it changesCraig Scott2024-09-061-1/+3
| | |
* | | Help: Recommend good prefixes for cmake_parse_arguments, expand exampleCraig Scott2024-08-311-25/+81
| | | | | | | | | | | | Fixes: #25773
* | | Help: Improve grammar and wording for cmake_parse_argumentsCraig Scott2024-08-311-28/+29
| |/ |/|
* | Drop Visual Studio 12 2013 generatorBrad King2024-08-281-1/+1
| | | | | | | | This generator has been deprecated since CMake 3.28. Remove it.
* | Merge topic 'if-space-dldt'Brad King2024-08-281-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 2c0d16df7b Help/command/if: fix formatting in precedence order overview Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9777
| * | Help/command/if: fix formatting in precedence order overviewAleksei Shpakovskii2024-08-271-2/+2
| | | | | | | | | | | | | | | Due to extra space symbols, it was rendered as definition list inside list item, instead of plain list item.
* | | Merge topic 'cps-export'Brad King2024-08-271-0/+59
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 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
| * | export: Add initial CPS supportMatthew Woehlke2024-08-141-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge topic 'cmake-parse-arguments-one-arg-empty-string'Brad King2024-08-261-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | cmake_parse_arguments: Set variable if empty string given after keywordCraig Scott2024-08-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge topic 'doc-get_property-undefined'Craig Scott2024-08-231-13/+14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Help: get_property() result var is unset if property is not setCraig Scott2024-08-221-3/+4
| | | | | | | | | | | | | | | | | | | | Fixes: #26152
| * | | | Help: Minor formatting and grammar fixes for get_property()Craig Scott2024-08-221-10/+10
| |/ / /
* | | | Help/command/if: list all condition operators in precedence order overviewAleksei Shpakovskii2024-08-221-2/+4
|/ / / | | | | | | | | | | | | This section is near the top and so can serve as an exhaustive table of contents for the things that `if()` can check.
* | | Help/command/if: Document variable expansion by IN_LISTBrad King2024-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge topic 'fix-dependencies-searching'Brad King2024-08-201-0/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | file(GET_RUNTIME_DEPENDENCIES): Fix resolution of repeated ELF dependenciesAliaksandr Averchanka2024-08-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Help: State valid scopes for using proj_SOURCE_DIR and proj_BINARY_DIRCraig Scott2024-08-171-2/+9
|/ / / | | | | | | | | | Fixes: #25714
* | | Help(install): Move RENAME docs to FILES signatureFeRD (Frank Dana)2024-08-011-5/+4
|/ / | | | | | | | | | | 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.