summaryrefslogtreecommitdiffstats
path: root/Help/manual/cmake-policies.7.rst
Commit message (Collapse)AuthorAgeFilesLines
* export: Disable PACKAGE mode user package registry by defaultRobert Maynard2019-03-151-0/+2
| | | | | | | The user package registry populated by the `export()` command causes side effects outside the build and source directories. Such effects should be opt-in rather than op-out. Introduce a policy to change default behavior of `export(PACKAGE)` to do nothing.
* XLClang: Add policy CMP0089 to present as XL for compatibilityBrad King2019-02-251-0/+8
| | | | | | | | We now identify IBM's Clang-based XL compilers, which define `__ibmxl__`, as `XLClang` rather than `XL`. In order to support existing project code that checks for `XL`, add a policy whose OLD behavior is to present the compiler id as `XL` and whose NEW behavior is to present the compiler id as `XLClang` as we really detect it.
* FindBISON: Add policy CMP0088 to run bison in build treeRobert Maynard2019-01-101-0/+1
|
* install: Teach CODE,SCRIPT modes to evaluate generator expressionsJon Chronopoulos2018-12-221-0/+1
| | | | | | | This also introduces CMP0087 which will keep the OLD behaviour of not evaluating generator expressions Fixes: #15785
* UseSWIG: add management of SWIG option -moduleMarc Chevrier2018-12-071-0/+1
| | | | | | | 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-0/+1
| | | | | | | | | | 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-0/+1
| | | | | | | | 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-0/+1
| | | | Fixes: #14983, #16561
* add_subdirectory: Run subdirectory install rules in correct orderKyle Edwards2018-10-101-0/+8
| | | | | | | | | 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-0/+1
|
* BundleUtilities: Disallow inclusion at configure timeKyle Edwards2018-09-191-0/+1
| | | | | | 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-0/+1
| | | | | | | | | | | | | | | | | | | | | 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-0/+1
|
* option: respect existing normal variableRobert Maynard2018-07-091-0/+1
| | | | 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-0/+8
| | | | | | | | | | 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
* CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIESBrad King2018-04-181-0/+1
| | | | | | | | | | | | | 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
* find_package: Use PackageName_ROOT variables as search prefixesBrad King2018-03-161-0/+1
| | | | | | | | | | | | | | | | | | | 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-0/+8
| | | | | | Introduce policy `CMP0073` to avoid producing these cache entries. Fixes: #16364
* FindOpenGL: Add policy CMP0072 to prefer GLVND for legacy GLBrad King2017-11-171-0/+8
| | | | Fixes: #17449
* Autogen: Process GENERATED files. Add CMP0071.Sebastian Holtermann2017-07-181-0/+1
| | | | | | | | | | 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/+8
| | | | | | | | | 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 policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATIONRuslan Baratov2017-03-301-0/+1
| | | | | | | | | 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-0/+8
| | | | | | | | 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-0/+8
| | | | | | | | | | | | | | 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
* try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG>Brad King2016-06-291-0/+8
| | | | | | | | | | | | | | | | 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.
* Help: Add policy summaries to cmake-policies(7)Brad King2016-05-021-66/+66
| | | | | | | | In Sphinx output formats that print the toctree the policy numbers in links from the cmake-policies(7) manual are not descriptive. Convert the toctree entries to cross-reference syntax and add the summary of each policy. For now simply duplicate the policy summary line. We already maintain copies in `cmPolicies.h` and `Help/policy/*.rst` docs.
* Help: Organize cmake-policies(7) manual by version of introductionBrad King2016-05-021-67/+109
|
* CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGSChuck Atkins2015-09-211-0/+1
| | | | | This new policy restricts the addition of the shared library link flags to executables only when the ENABLE_EXPORTS property is set to True.
* if: Add "TEST <test>" conditionMatt McCormick2015-08-031-0/+1
| | | | | | | | 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.
* Help: Document explicitly that policy OLD behavior is deprecatedBrad King2015-06-091-5/+5
| | | | | | | | | | | The most likely documentation page a project author will read in response to a policy warning is the page for the policy itself. Add to every policy documentation page a note explicitly stating that the OLD behavior is deprecated. Also mention this in the cmake_policy() command documentation that explains how to set a policy to OLD. Suggested-by: Fraser Hutchison <fraser.hutchison@gmail.com>
* Honor visibility properties for all target types (#15556)Brad King2015-05-261-0/+1
| | | | | | | | | | | | | | | | 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.
* install: Disallow installing export() result.Stephen Kelly2015-05-141-0/+1
|
* CTest: Stop telling 'make' to ignore errors with -iBrad King2015-05-121-0/+1
| | | | Add policy CMP0061 to maintain compatibility for existing projects.
* Link libraries by full path even in implicit directoriesBrad King2015-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | When CMP0003 was first introduced we wanted to link all libraries by full path. However, some projects had problems on platforms where find_library would find /usr/lib/libfoo.so when the project really wanted to link to /usr/lib/<arch>/libfoo.so and had been working by accident because pre-CMP0003 behavior used -lfoo to link. We first tried to address that in commit v2.6.0~440 (Teach find_library to avoid returning library paths in system directories, 2008-01-23) by returning just "foo" for libraries in implicit link directories. This caused problems for projects expecting find_library to always return a full path. We ended up using the solution in commit v2.6.0~366 (... switch library paths found in implicit link directories to use -l, 2008-01-31). However, the special case for libraries in implicit link directories has also proven problematic and confusing. Introduce policy CMP0060 to switch to linking all libraries by full path even if they are in implicit link directories. Explain in the policy documentation the factors that led to the original approach and now to this approach.
* Do not treat DEFINITIONS as a built-in directory propertyStephen Kelly2015-04-021-0/+1
| | | | | | | | Add policy CMP0059 to cover this change. The property has been deprecated since CMake 2.4 anyway. This will help clean up cmMakefile -- the DefineFlagsOrig member should not need to exist.
* Ninja: Add policy to require explicit custom command byproductsBrad King2015-03-201-0/+1
| | | | | | | | | | | | Add policy CMP0058 to avoid generating 'phony' ninja rules for unknown custom command dependencies. This requires projects to specify their custom command byproducts explicitly. With this requirement we no longer have to assume that unknown custom command dependencies are generated and can instead simply assume they are source files expected to exist when the build starts. This is particularly important in in-source builds. It is also helpful for out-of-source builds to allow Ninja to diagnose missing files before running custom command rules that depend on them.
* add_custom_command: Diagnose MAIN_DEPENDENCY limitation.Nils Gladitz2015-03-091-0/+1
| | | | | The new policy CMP0057 diagnoses reuse of the same MAIN_DEPENDENCY across multiple custom commands.
* try_compile: Pass linker flags into test project (#14066)Brad King2014-12-031-0/+1
| | | | | | | | | | | | Copy CMAKE_EXE_LINKER_FLAGS into the test project generated by try_compile, just like we already copy CMAKE_<LANG>_FLAGS. Add CMake Policy CMP0056 to activate this behavior in a compatible way, but do not warn by default when the policy is not set since it will affect all try_compile calls. Extend the RunCMake.try_compile test with a case covering this behavior for each policy setting.
* break: Add policy CMP0055 to check calls strictlyGregor Jasny2014-11-251-0/+1
| | | | | | Reject break() without loop scope or any arguments. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* Merge branch 'release-doc-formatting' into doc-formattingBrad King2014-11-061-1/+1
|\ | | | | | | | | Resolve conflict in Modules/ExternalProject.cmake by keeping our side, which is more completely revised.
| * Help: Drop TOC from latex manualsBrad King2014-11-061-1/+1
| | | | | | | | A latex document can have its own TOC.
* | Help: Document that policies are not feature toggles.Stephen Kelly2014-10-201-0/+6
|/
* If: Introduce policy CMP0054 - don't dereference quoted variables in if()Nils Gladitz2014-09-111-0/+1
|
* EVIS: Add policy CMP0053Ben Boeckel2014-05-081-0/+1
| | | | | This policy switches between the old EVIS parser and the new, faster parser.
* Export: Disallow exported interface includes in src/build tree (#14592).Stephen Kelly2014-04-091-0/+1
| | | | | | | | | | | Allow directories in the source tree or build tree only if the install tree is a subdirectory of the source tree or build tree, as appropriate. Re-use the test files in the RunCMake.include_directories test to run in multiple scenarios. Bump the required CMake version in the test to 3.0 to ensure that the new policy warnings are emitted correctly.
* cmTarget: Include TARGET_OBJECTS genex in target SOURCES property.Stephen Kelly2014-04-021-0/+1
| | | | Add policy CMP0051 to control this behavior.
* add_custom_command: Disallow use of SOURCE signatures.Stephen Kelly2014-02-121-0/+1
| | | | Add CMP0050 to control this behavior.
* Add policy CMP0049 to avoid variable expansion in source listsStephen Kelly2014-02-121-0/+1
|
* Help: Mark up references to NEW and OLD policy settings properly.Stephen Kelly2014-02-061-4/+4
|
* project: Manage VERSION variablesBrad King2014-01-291-0/+1
| | | | | | | | | | | | | | | | Teach the project() command to set variables {PROJECT,<PROJECT-NAME>}_VERSION{,_MAJOR,_MINOR,_PATCH,_TWEAK} holding the project version number and its components. Add project() command option "VERSION" to specify the version explicitly, and default to the empty string when it is not given. Since this clears variables when no VERSION is given, this may change behavior for existing projects that set the version variables themselves prior to calling project(). Add policy CMP0048 for compatibility. Suggested-by: Alex Neundorf <neundorf@kde.org>