summaryrefslogtreecommitdiffstats
path: root/Help/policy
Commit message (Collapse)AuthorAgeFilesLines
* CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)Craig Scott2024-11-151-2/+2
| | | | Fixes: #26449
* Help: Add missing one-line summary to policy CMP0132Brad King2024-11-111-0/+2
| | | | | This was missed in commit 05e510bf0b (CMP0132: Don't set compiler environment variables on first run, 2022-03-23, v3.24.0-rc1~380^2).
* cmake_parse_arguments: Restore capture of value after repeated keywordCraig Scott2024-10-281-10/+14
| | | | | | | | | | | | | | | | | | | When a single-value keyword is repeated, and the first instance is missing a value, it prevents the value from the second instance from being stored in a variable. This was a regression introduced by commit ceeea4e511 (cmake_parse_arguments: Set variable if empty string given after keyword, 2024-08-18). That change also didn't create a variable if the keyword was given but without a value. The purpose of the change was to always define a variable if a keyword was given. Lastly, that change didn't protect the CMP0174 logic to make it only apply to the PARSE_ARGV form. The first two of the above problems are fixed here by tracking the keywords given instead of checking which keywords were missing values. The third problem is also fixed here, being tightly coupled to the same logic as the first two problems. Fixes: #26397
* project: Always set <PROJECT-NAME>_* as normal variablesCraig Scott2024-10-081-0/+36
| | | | | | | | | | 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
* Static libraries de-duplication: keep first occurrenceMarc Chevrier2024-10-022-0/+33
| | | | Fixes: #26335
* tests: Preserve empty arguments in test command linesCraig Scott2024-10-021-0/+37
| | | | | | | | | | | | | | | | | | | | This will now preserve empty values in the TEST_LAUNCHER and CROSSCOMPILING_EMULATOR target properties for tests added by: - The add_test() command. - The ExternalData_Add_Test() command from the ExternalData module. - The gtest_add_tests() or gtest_discover_tests() commands from the GoogleTest module. For the gtest_add_tests() and gtest_discover_tests() commands, empty elements in the values passed after the EXTRA_ARGS keyword are also now preserved. Policy CMP0178 is added to provide backward compatibility with the old behavior where empty values were silently discarded from the above cases. Fixes: #26337
* install: Normalize DESTINATION pathsCraig Scott2024-09-191-0/+38
| | | | | | | | | | | | | | 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
* execute_process: Change default ENCODING to UTF-8Brad King2024-09-161-0/+27
| | | | | | | | | | | | | 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
* add_custom_command: Validate arguments more rigorouslyCraig Scott2024-09-091-0/+40
| | | | | | | Add a new CMP0175 policy to preserve backward compatibility for projects that were using unsupported keywords or arguments. Fixes: #26096, #21089, #18976
* cmake_parse_arguments: Set variable if empty string given after keywordCraig Scott2024-08-221-0/+33
| | | | | | | | | | | | | | | 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
* CMakeFindFrameworks: Deprecate the module subject to policy CMP0173Craig Scott2024-08-161-0/+22
| | | | Fixes: #20446
* CPack/WIX: Generate perMachine installers by defaultBrad King2024-07-181-0/+39
| | | | | | | | | | | Add policy CMP0172 to set `CPACK_WIX_INSTALL_SCOPE` to `perMachine` by default. Follow up commit 60661f6770 (CPack/WiX: Make InstallScope configurable, 2023-11-07, v3.29.0-rc1~413^2) and commit 614100dbf6 (CPack/WiX: Restore default (missing) InstallScope from 3.28 and lower, 2024-06-05, v3.30.0-rc1~7^2~1). Issue: #20962 Issue: #26029
* add_custom_command: Add CODEGEN supportJuan Ramos2024-07-011-0/+26
| | | | | | | | | | | 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.
* Help: Minor grammar and formatting cleanupCraig Scott2024-06-141-2/+2
|
* FetchContent: Force cmake --fresh to re-execute direct population stepsCraig Scott2024-06-071-0/+8
| | | | Issue: #25468
* FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirementsCraig Scott2024-05-291-0/+30
| | | | | | | FETCHCONTENT_FULLY_DISCONNECTED should only be set to true if each dependency's source directory has already been populated. Previously, this wasn't being checked, but now it is (subject to a new policy).
* FetchContent: Deprecate FetchContent_Populate(depName)Craig Scott2024-05-291-0/+49
| | | | | Projects should use FetchContent_MakeAvailable(depName) instead. Policy CMP0169 provides backward compatibility.
* Merge topic 'cmp0097-fetchcontent'Brad King2024-05-201-3/+12
|\ | | | | | | | | | | | | eda17e76e2 Help: Document that CMP0097 is always NEW for FetchContent Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9527
| * Help: Document that CMP0097 is always NEW for FetchContentCraig Scott2024-05-171-3/+12
| | | | | | | | Fixes: #25971
* | FetchContent: Populate directly without a sub-buildCraig Scott2024-05-171-0/+64
|/ | | | Fixes: #21703
* Merge topic 'FindBoost-remove'Brad King2024-05-061-0/+28
|\ | | | | | | | | | | | | | | | | e0355c4ea9 FindBoost: Add policy to remove this module Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Christoph GrĂ¼ninger <foss@grueninger.de> Merge-request: !9488
| * FindBoost: Add policy to remove this moduleBrad King2024-05-031-0/+28
| | | | | | | | | | | | | | | | | | | | Upstream Boost 1.70 and above provide a proper `BoostConfig.cmake` package configuration file. Packages for all major distros now provide it in at least one LTS release. Add a policy to pretend that the `FindBoost` module does not exist so that projects calling `find_package(Boost)` use the upstream package directly. Closes: #19402
* | Help: Clarify cmake-buildsystem(7) compile properties section namesBrad King2024-05-031-2/+2
|/ | | | | | | | | | In commit 835f34949e (Help: Update cmake-buildsystem(7) build and usage requirements, 2024-04-23) we labeled the sections documenting `COMPILE_*` properties as "build properties". All the properties it documents are about compilation steps before linking, including the Autogen features for compiling Qt metadata, so rename the sections as "compile properties". This is also consistent with the name of the `$<COMPILE_ONLY:...>` generator expression.
* GenEx: Fix TARGET_PROPERTY evaluation of transitive link propertiesBrad King2024-04-292-0/+46
| | | | | | | | | In commit bbba701899 (Link properties: must be transitive over private dependency on static library, 2019-12-06, v3.17.0-rc1~323^2) and commit af9d4f24ae (Link properties: must be transitive over private dependency on static library, 2019-12-11, v3.17.0-rc1~305^2) we neglected to implement CMP0099 NEW behavior for `TARGET_PROPERTY` evaluation. Add policy CMP0166 to fix this.
* Help: Clarify CMP0099 documentation and summary textBrad King2024-04-291-5/+8
|
* Help: CMP0135 applies to FetchContent as wellCraig Scott2024-04-271-9/+9
| | | | | | | | This updates the CMP0135 documentation, which should have been done as part of c2044fdf3f (FetchContent: Respect the CMP0135 policy setting, 2022-06-02). Issue: #23560
* enable_language(): Fail if called before project()Craig Scott2024-04-021-0/+26
| | | | Fixes: #25550
* Merge topic 'check-Werror-CMP0066'Brad King2024-04-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | cebcc07a80 CheckSymbolExists: Remove -Werror from per-config flags 06c99ce73b CheckSymbolExists: Avoid removing the flag after -Werror e60281e968 CMakeDetermineCompilerABI: Remove -Werror from per-config flags 6abd25e7fd Help: Fix a typo Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9377
| * Help: Fix a typoSung, Po Han2024-03-281-1/+1
| |
* | add_library: Reject shared libraries on platforms that do not support themAsit Dhal2024-03-291-0/+31
| | | | | | | | | | | | Add policy CMP0164 to provide compatibility. Fixes: #25759
* | CMP0163: Make GENERATED source file property globally visibleDeniz Bahadir2024-03-292-0/+43
|/ | | | | | | | | | | | | | | This was originally attempted by policy CMP0118, but its implementation did not cover all intended use cases. We fixed its documentation in commit 1dabbbb5e0 (CMP0118: Revise documentation to describe actual behavior, 2024-03-20). Add new policy CMP0163 to cover the remaining use cases. In particular, make the `GENERATED` property visible to `get_property` calls in other directories. In order to capture the original intention of CMP0118, define CMP0163's NEW behavior to also imply CMP0118's NEW behavior. Fixes: #25437 Fixes: #25058
* CMP0118: Revise documentation to describe actual behaviorDeniz Bahadir2024-03-211-12/+17
| | | | | | | | The policy was originally intended to make the `GENERATED` source file property globally visible, but the implementation didn't fully achieve that goal. Revise the documentation to describe what it actually does. Issue: #25437
* Merge topic 'doc-release-3.29-typos'Brad King2024-03-191-3/+3
|\ | | | | | | | | | | | | | | eceb368ccc Help: Fix typos in 3.29 docs 31fb693d06 Help: Fix typos and grammar in pre-3.29 docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9353
| * Help: Fix typos in 3.29 docsCraig Scott2024-03-191-3/+3
| |
* | VS: Add UseDebugLibraries to vcxproj files by defaultBrad King2024-02-221-0/+47
|/ | | | | | | Use heuristics to select a reasonable value. Add policy CMP0162 to provide compatibility with existing projects. Fixes: #25327
* CPack: Change CPACK_PRODUCTBUILD_DOMAINS default to true (CMP0161)Craig Scott2024-01-281-0/+36
| | | | Fixes: #23351
* Merge topic 'validate_read-only_target_properties'Brad King2024-01-241-0/+39
|\ | | | | | | | | | | | | | | 0cfd8fe8ad cmTarget: Don't allow setting read-only properties Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9133
| * cmTarget: Don't allow setting read-only propertiesRobert Maynard2024-01-231-0/+39
| | | | | | | | | | Ensure that all documented read-only target properties now produce errors when trying to set.
* | Help: Fix typo in CMP0156 documentationBrad King2024-01-161-1/+1
|/
* Help: Clarify standard policy advice paragraph wording on how policies are setBrad King2024-01-111-1/+1
| | | | Avoid implying that a policy must always be set explicitly.
* Help: Drop current CMake version from standard policy advice paragraphBrad King2024-01-111-1/+1
| | | | | | Every policy documents whether CMake warns when it is not set. This behavior does not change with the CMake version, so avoid possibly confusing mention of the current CMake version.
* Help: Normalize and consolidate standard policy advice paragraphBrad King2024-01-11152-557/+510
| | | | | | | | Every policy's documentation has a paragraph on what version of CMake introduced it, how to set the policy, and whether CMake warns if the policy is not set. The wording of this paragraph has diverged across policies over time. Factor the paragraph out into a standard advice document included by every policy.
* file: `STRINGS` + `REGEX` store match resultsCristian Le2024-01-091-0/+24
| | | | Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
* add_test: Fix version of CMake introducing CMP0158 (to 3.29)Robert Maynard2024-01-051-0/+2
| | | | | | This was missed in commit ca5a300d7f (add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compiling, 2023-11-02) when it slipped from the 3.28 release.
* add_test: Honor CROSSCOMPILING_EMULATOR only when cross-compilingRalf Habacker2023-12-191-0/+27
| | | | | | Add policy CMP0158 to provide compatibility for existing projects. Fixes: #23672
* Merge topic 'doc-CMP0149'Brad King2023-11-201-0/+7
|\ | | | | | | | | | | | | fe0d03b044 Help: Document that CMP0149 should be set before project() Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8990
| * Help: Document that CMP0149 should be set before project()Brad King2023-11-201-0/+7
| | | | | | | | Issue: #25413
* | Swift: Add abstraction for compilation modeEvan Wilde2023-11-171-0/+48
| | | | | | | | | | | | | | | | | | | | | | Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding `Swift_COMPILATION_MODE` target property to control the compilation mode. Select among `wholemodule`, `singlefile`, and `incremental`. Add policy CMP0157 to remove the default `-wmo` flags in favor of the abstract setting. Issue: #25366
* | Link step: Enable to configure deduplication of librariesMarc Chevrier2023-11-091-0/+47
| | | | | | | | | | | | | | | | | | Some platforms, Apple or Windows for instance, do not require to duplicate static libraries to resolve mutual dependencies. Moreover, Xcode version 15 emits a warning if a library is duplicated. On Windows, enable a better control of libraries order. Fixes: #20722, #25297
* | CMP0155: ignore scanning for sources if no scanner is availableBen Boeckel2023-11-011-2/+4
| | | | | | | | | | | | | | | | | | | | This allows for a more graceful transition for projects using C++20 without scanner support (e.g., Clang 15 or GCC 13). While newer compilers will (needlessly) scan, it allows C++20-using projects to use older compilers without having to set `CMAKE_CXX_SCAN_FOR_MODULES` to support newer CMake minimum versions. Fixes: #25357