summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
Commit message (Collapse)AuthorAgeFilesLines
* UseSWIG: add management of SWIG option -moduleMarc Chevrier2018-12-071-1/+4
| | | | | | | When file property SWIG_MODULE_NAME is specified, provide option -module to SWIG compiler. Fixes: #18374
* Genex: Add policy to handle empty list items in $<IN_LIST:...>Kyle Edwards2018-11-191-1/+3
| | | | | | | | | | The old behavior of $<IN_LIST:...> is inconsistent with that of if(IN_LIST), in that it does not find an empty search item even if the list contains empty items. This change adds a new policy to correctly handle empty items and make the behavior more consistent with if(IN_LIST). Fixes: #18556
* find_package(): Add policy to remove the FindQt moduleKyle Edwards2018-11-141-1/+4
| | | | | | | | Removing FindQt.cmake gives Qt upstream a path forward to export its own QtConfig.cmake files which can be found by find_package() without having to explicitly specify CONFIG. Projects that still want to use Qt3/4 can call find_package(Qt[34]), include(FindQt), or add FindQt.cmake to their CMAKE_MODULE_PATH.
* POSITION_INDEPENDENT_CODE: Manage link flags for executablesMarc Chevrier2018-11-111-2/+5
| | | | Fixes: #14983, #16561
* Merge topic 'cmake_policy-get_warning'Brad King2018-10-111-1/+1
|\ | | | | | | | | | | | | | | 0d988f98e5 cmake_policy: Add undocumented GET_WARNING command f9f96598df Help: Convert FindOpenGL documentation to block comment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2472
| * cmake_policy: Add undocumented GET_WARNING commandKyle Edwards2018-10-101-1/+1
| | | | | | | | | | | | | | This command is intended for modules that issue policy warnings so they can get the warning string from CMake in a uniform manner, rather than duplicating the string. Several modules been updated to include an example of the usage of this new command.
* | add_subdirectory: Run subdirectory install rules in correct orderKyle Edwards2018-10-101-1/+5
|/ | | | | | | | | Before this change, install rules created by add_subdirectory() would be executed after all of the top-level install rules, even if they were declared before the top-level rules. This change adds a new policy, CMP0082, which interleaves the add_subdirectory() install rules with the other install rules so they are run in the correct order.
* LINK_DIRECTORIES target property: add policy for absolute paths check.Marc Chevrier2018-09-251-2/+6
|
* BundleUtilities: Disallow inclusion at configure timeKyle Edwards2018-09-191-1/+4
| | | | | | This commit adds a new CMake policy, CMP0080, which prohibits the inclusion of BundleUtilities at configure time. The old behavior is to allow the inclusion.
* target_link_libraries: Allow use with targets in other directoriesBrad King2018-09-121-1/+5
| | | | | | | | | | | | | | | | | | | | | Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Targets named on the RHS will need to be looked up during generation in the scope of the call site rather than the scope of the LHS target. Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties to specify target names that need to be looked up in a directory other than that containing the target on which the property is set. Add minimal documentation of the syntax to help users that encounter it. Unfortunately CMake previously did allow such calls in the case that only `INTERFACE` libraries are specified, but those libraries would be looked up in the target's directory rather than the caller's. Add policy `CMP0079` to enable the new behavior with new lookup scope in a compatible way. Fixes: #17943
* UseSWIG: add policy to manage target naming strategy.Marc Chevrier2018-07-251-1/+3
|
* Merge topic 'doc-find_package-root'Craig Scott2018-07-201-2/+2
|\ | | | | | | | | | | | | 492ade276b Help: Add explicit <PackageName>_ROOT variable documentation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2225
| * Help: Add explicit <PackageName>_ROOT variable documentationBrad King2018-07-201-2/+2
| | | | | | | | | | | | Add documentation for both the CMake variable and environment variable of this name pattern. Update references to these names to link to their documents. Clarify the pattern used to construct their names.
* | option: respect existing normal variableRobert Maynard2018-07-091-1/+3
| | | | | | | | Add policy CMP0077 to change this behavior in a compatible way.
* | target_sources: Interpret relative paths as relative to the calling directoryPatrick Stotko2018-06-181-2/+6
|/ | | | | | | | | | Previously the command considered non-absolute source file paths relative to the associated target on the LHS. This causes problems in incremental builds where files are added from subdirectories and forces users to workaround by manually converting to absolute paths. Change this to enable more intuitive usage by projects. Fixes #17981
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-2/+3
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Modules: Update documented links to CMake community WikiBrad King2018-04-301-3/+1
| | | | The wiki has moved. Update links to reference the new pages.
* CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIESBrad King2018-04-181-1/+4
| | | | | | | | | | | | | Other check modules honor this variable, so include file checks should too. Add policy `CMP0075` to enable the behavior in a compatible way. This change was originally made by commit v3.11.0-rc1~108^2 (CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES, 2017-12-24) but it was reverted by commit v3.11.1~9^2 (Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES", 2018-04-04) because the behavior change could affect checks in existing projects in an incompatible way. Fixes: #9514
* Merge topic 'policy-version-range'Craig Scott2018-03-221-1/+5
|\ | | | | | | | | | | | | | | | | | | 45408b5ea1 cmake_minimum_required: Optionally set policies with version range 6a41aa2abd cmPolicies: Split parsing and impl of ApplyPolicyVersion 1d00ed7cf7 cmPolicies: Drop unnecessary check from ApplyPolicyVersion 0df559832b cmPolicies: Pass policy version as std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1864
| * cmake_minimum_required: Optionally set policies with version rangeBrad King2018-03-211-1/+2
| | | | | | | | | | | | | | | | Teach `cmake_minimum_required` and `cmake_policy(VERSION)` to support a version range of the form `<min>[...<max>]`. Define this to mean that version `<min>` is required, but known policies up to those introduced by `<max>` will be set to `NEW`. This will allow projects to easily specify a range of versions for which they have been updated.
| * cmPolicies: Split parsing and impl of ApplyPolicyVersionBrad King2018-03-161-0/+2
| | | | | | | | Also rename local variables to clarify their role during parsing.
| * cmPolicies: Pass policy version as std::stringBrad King2018-03-161-1/+2
| |
* | find_package: Use PackageName_ROOT variables as search prefixesBrad King2018-03-161-1/+3
|/ | | | | | | | | | | | | | | | | | | This feature was originally added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and documented by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). However, we had to disable the feature and remove the documentation in commit v3.9.1~2^2 (find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9, 2017-08-08) due to breaking projects that used `PackageName_ROOT` variables themselves. Add policy `CMP0074` to restore the `PackageName_ROOT` variable behavior in a compatible way. Also revise the stack of root paths to store the paths themselves rather than the package names. This way the policy can be considered at the `find_package` call site instead of individual `find_` calls inside a find module. Co-Author: Chuck Atkins <chuck.atkins@kitware.com> Issue: #17144
* Do not produce legacy _LIB_DEPENDS cache entriesBrad King2018-03-071-1/+5
| | | | | | Introduce policy `CMP0073` to avoid producing these cache entries. Fixes: #16364
* FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GLBrad King2017-11-171-1/+4
| | | | Fixes: #17449
* Merge topic 'cmp0037-conditional-targets'Brad King2017-10-311-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | ae5f4069 CMP0037: Allow test and package targets when features are not enabled 409527a0 CMP0037: De-duplicate check and message generation a2611d81 Tests: Add RunCMake.CMP0037 case for WARN on reserved targets 103501c4 Tests: Do not enable languages in all cases of RunCMake.CMP0037 2d0b3e6e cmGlobalGenerator: Refactor test and package target conditions Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !1417
| * CMP0037: Allow test and package targets when features are not enabledBrad King2017-10-301-0/+1
| | | | | | | | | | | | | | When CMake will not generate a test, package, or package_source target, allow projects to create their own targets with these names. Fixes: #16062
* | CMP0040: Clarify policy warning to match documentationBrad King2017-10-261-1/+1
|/ | | | | | | | | In commit v3.5.0-rc1~8^2~2 (Help: Clarify policy `CMP0040` documentation, 2016-01-28) the documentation was clarified to indicate that the target must be defined in the current directory. Do the same for the text of the policy warning itself. Fixes: #17399
* Autogen: Process GENERATED files. Add CMP0071.Sebastian Holtermann2017-07-181-1/+3
| | | | | | | | | | This lets AUTOMOC and AUTOUIC process GENERATED files which used to be ignored before. A new policy CMP0071 ensures that the old behavior of ignoring GENERATED files is enabled when the CMake compatibility version CMAKE_MINIMUM_REQUIRED is < 3.10. Closes #16186
* file(GENERATE): Add policy CMP0070 to define relative path behaviorBrad King2017-06-091-0/+3
| | | | | | | | | Previously `file(GENERATE)` did not define any behavior for relative paths given to the `OUTPUT` or `INPUT` arguments. Define behavior consistent with CMake conventions and add a policy to provide compatibility for projects that relied on the old accidental behavior. Fixes: #16786
* Add deprecation warnings for policies CMP0036 and belowBrad King2017-04-211-0/+1
| | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for some policies to encourage projects to port away from setting policies to OLD.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATIONRuslan Baratov2017-03-301-1/+5
| | | | | | | | | Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was honored only for the Intel compiler on Linux and otherwise ignored. In order to add support for more compilers incrementally without changing behavior in the future, add a new policy whose NEW behavior enforces the `INTERPROCEDURAL_OPTIMIZATION` property. Add flags for supported compilers and otherwise produce an error.
* Add policy CMP0068 separate install_name and RPATH settings on macOSClinton Stimpson2017-02-141-2/+6
| | | | | | | | BUILD_WITH_INSTALL_RPATH, SKIP_BUILD_RPATH, CMAKE_SKIP_RPATH and CMAKE_SKIP_INSTALL_RPATH no longer any effect on the install name of a target on macOS. Fixes: #16589
* try_compile: Add policy CMP0067 to honor language standardsBrad King2016-12-061-1/+4
| | | | | | | | | | | | | | Projects use `try_compile` to check if they will be able to compile some particular source code. When a language standard variable like `CMAKE_CXX_STANDARD` is set, then the project intends to compile source code using a compiler mode for that standard. Therefore it makes sense for `try_compile` to use that standard in the test project too. Unfortunately this was not done when support for the `CMAKE_CXX_STANDARD` variable was first implemented. Add a policy to introduce the improved behavior in a compatible way. Closes: #16456
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-2/+2
|
* try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG>Brad King2016-06-291-1/+4
| | | | | | | | | | | | | | | | In the `try_compile` source file signature we propagate the caller's value of `CMAKE_<LANG>_FLAGS` into the test project. Extend this to propagate `CMAKE_<LANG>_FLAGS_<CONFIG>` too instead of always using the default value in the test project. This will be useful, for example, to allow the MSVC runtime library to be changed (e.g. `-MDd` => `-MTd`). However, some projects may currently depend on this not being done, so we need to activate the behavior using a policy. This change was originally made by commit v3.6.0-rc1~160^2 (try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11) but without the policy and so had to be reverted during the 3.6 release candidate cycle. Fixes #16174.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-228/+207
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* CMP0059: Fix typo in policy descriptionBrad King2016-05-021-1/+1
|
* cmGeneratorTarget: Copy the policy map from the cmTarget.Stephen Kelly2015-10-201-0/+17
|
* Replace http://www.cmake.org URLs with https://cmake.orgBrad King2015-09-251-1/+1
| | | | | | | The latter is now the preferred URL for visiting cmake.org with a browser. Convert using the shell code: git ls-files -z | xargs -0 sed -i 's|http://www\.cmake|https://cmake|g'
* CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGSChuck Atkins2015-09-211-0/+4
| | | | | This new policy restricts the addition of the shared library link flags to executables only when the ENABLE_EXPORTS property is set to True.
* CMP0064: Fix recorded version of introduction to be 3.4Brad King2015-09-211-1/+1
| | | | | This policy was added for CMake 3.4 but accidentally recorded as 3.3. Fix this and update the RunCMake.CMP0064 test WARN case accordingly.
* if: Add "TEST <test>" conditionMatt McCormick2015-08-031-0/+3
| | | | | | | | if(TEST TestNameThatExists) will return true if a test with the name TestNameThatExists has been added with add_test. The syntax is similar to if(TARGET TargetName). Since use of "TEST" as an argument to if() could previously be interpreted as a non-keyword argument, add policy CMP0064 to treat it as a keyword as NEW behavior.
* cmPolicies: Replace unused include.Stephen Kelly2015-07-251-1/+1
|
* cmPolicies: Store only state that users can set.Stephen Kelly2015-07-251-1/+1
| | | | | cmPolicies::PolicyMap does not need to store the REQUIRED_ALWAYS or REQUIRED_IF_USED states as they are statically determined.
* cmPolicies: Store all statuses in a single bitset.Stephen Kelly2015-06-071-5/+2
| | | | | | | | Currently there are an optimal number of policies (64) such that there are no wasted bits. When another policy is added, the cmPolicyMap will grow from 40 bytes to 80, and occupy 45. By storing all in a single bitset, we stay under the cache line size of 64 bytes until there are 512 policies in a range.
* cmPolicies: Replace UNDEFINED bitset with WARN bitset.Stephen Kelly2015-06-061-2/+1
| | | | Might as well use the existing concept.
* Honor visibility properties for all target types (#15556)Brad King2015-05-261-0/+3
| | | | | | | | | | | | | | | | The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN were first merged in commit v2.8.12~322 (Merge topic 'VISIBILITY_PRESET-property', 2013-06-05) but worked only for shared libraries and executables with exports. Prior to commit v3.0.0-rc1~581^2 (GenerateExportHeader: Deprecate add_compiler_export_flags function., 2013-09-02) the add_compiler_export_flags function was used to add visibility flags to all targets. The visibility flags are useful for sources in all target types because they may be later linked into shared libraries or executables with exports. Introduce policy CMP0063 to enable them for all target types while preserving compatibility with existing projects that do not expect this.