summaryrefslogtreecommitdiffstats
path: root/Help/manual/cmake-policies.7.rst
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QNX: Introduce QCC compiler id for that QNX platform compiler.Stephen Kelly2014-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Introduce policy CMP0047 to control resetting the id for compatibility. De-duplicate content in the QNX platform file by including the GNU one. QNX is a form of GNU platform. Do not clear CMAKE_SHARED_LIBRARY_${lang}_FLAGS variables. They are populated again later by the Compiler/GNU.cmake file anyway. Modify the CMAKE_CXX_COMPILE_OBJECT variable only when the QCC compiler id is in use, and the language is CXX. Use the QNX recommended flag for QCC instead of the gcc compatible -x flag. Populate new module files to handle system includes and depfiles when using the QCC compiler. Remove code which unsets the system include and depfiles related variables. When a GNU driver is used instead of the QCC one, the appropriate flags will be used. These variables were previously cleared for lowest-common-denominator compatibility with both drivers.
* AddDependencies: new policy requires dependencies to existNils Gladitz2014-01-121-0/+1
| | | | | Added new policy CMP0046 which requires dependencies added by add_dependencies() to actually exist.
* Merge topic 'extend-docs'Brad King2014-01-091-1/+3
|\ | | | | | | | | | | 2f15a07 Help: Link to CMAKE_POLICY_DEFAULT_CMP<NNNN> in policies manual. bb8bde3 Help: Add notes about relocatability of config-file packages.
| * Help: Link to CMAKE_POLICY_DEFAULT_CMP<NNNN> in policies manual.Stephen Kelly2014-01-091-1/+3
| |
* | get_target_property: Error on non-existent target.Stephen Kelly2014-01-081-0/+1
| | | | | | | | Introduce policy CMP0045 to control this behavior.
* | Genex: Use case-sensitive comparison for COMPILER_ID.Stephen Kelly2014-01-081-0/+1
| |
* | cmTarget: Deprecate COMPILE_DEFINITIONS_ properties with a policy.Stephen Kelly2014-01-081-0/+1
|/
* Help: Mark some code blocks as containing cmake code.Stephen Kelly2014-01-041-1/+3
|
* Merge topic 'rpath-default'Brad King2014-01-021-0/+1
|\ | | | | | | | | d25ad48 OS X: Add CMP0042 to enable MACOSX_RPATH by default
| * OS X: Add CMP0042 to enable MACOSX_RPATH by defaultClinton Stimpson2014-01-021-0/+1
| | | | | | | | | | Also adding documentation for CMAKE_MACOSX_RPATH, and improving documentation for MACOSX_RPATH.
* | Help: Mention if(POLICY) and NO_POLICY_SCOPE in policies manual.Stephen Kelly2013-12-201-1/+15
|/
* Export: Report error on relative include with genex.Stephen Kelly2013-11-261-0/+1
| | | | | | | | | | | | Diagnostics which check the sanity of exported include paths previously skipped over any path containing a generator expression. Introduce a policy to issue an error message in such cases. The export files created in the OLD behavior are not usable, because they contain relative paths or paths to the source or build location which are not suitable for use on installation. CMake will report an error on import.
* Add policy CMP0040 to disallow custom commands on missing targetsNils Gladitz2013-11-211-0/+1
|
* Disallow linking to utility targets (#13902).Stephen Kelly2013-11-071-0/+1
|
* Disallow link-to-self (#13947).Stephen Kelly2013-11-071-0/+1
|
* Disallow invalid target names (#13140)Stephen Kelly2013-11-071-0/+1
| | | | | Exclude Borland and NMake from the CMP0037 test. They do not accept the colon in a target name.
* Help: Limit reference manual toctree depth to 1Brad King2013-11-011-0/+2
| | | | | | Add a :maxdepth: option to all toctree directives to limit their depth to 1. We do not want subheadings from individual documents to pollute the already large lists of CMake Domain objects.
* Help: Glob manual/*.rst in Sphinx configurationBrad King2013-10-301-0/+2
| | | | | | | Add the man page description line as explicit markup at the top of each Help/manual/*.rst file and scan it from conf.py to automatically generate the man_pages Sphinx configuration value. This reduces the number of places that need to be changed when a new manual is added.
* Add policy CMP0036 to disallow build_nameBrad King2013-10-221-0/+1
|