summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
Commit message (Collapse)AuthorAgeFilesLines
* Add policy CMP0025 for Apple Clang compiler id compatibilityBrad King2013-10-081-0/+1
| | | | | | | | | | The parent commit introduced a separate "AppleClang" compiler id for Apple's Clang distribution. Add a policy in order to support projects that expect this compiler's id to be just "Clang". When the policy is OLD or not set, map AppleClang back to Clang. Continue to use the AppleClang id internally while enabling the language, but set the CMAKE_<LANG>_COMPILER_ID after project() or enable_language() to the compatible value for use by project code.
* export: Add policy CMP0024 to disallow include() of export filesStephen Kelly2013-10-071-0/+1
| | | | | | | | | | | | | | | | | Currently, export() is executed at configure-time. One problem with this is that certain exported properties like the link interface may not be complete at the point the export() is encountered leading to an incorrect or incomplete exported representation. Additionally, the generated IMPORTED_LOCATION property may even be incorrect if commands following the export() have an effect on it. Another problem is that it requires the C++ implementation of cmake to be capable of computing the exported information at configure time. This is a limitation on the cleanup and maintenance of the code. At some point in the future, this limitation will be dropped and more implementation will be moved from cmTarget to cmGeneratorTarget.
* target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signatureStephen Kelly2013-07-241-0/+1
| | | | | | | Add a new signature to help populate INTERFACE_LINK_LIBRARIES and LINK_LIBRARIES cleanly in a single call. Add policy CMP0023 to control whether the keyword signatures can be mixed with uses of the plain signatures on the same target.
* Introduce the INTERFACE_LINK_LIBRARIES property.Stephen Kelly2013-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | This property replaces the properties which match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled for IMPORTED targets, and for non-IMPORTED targets only with a policy. For static libraries, the INTERFACE_LINK_LIBRARIES property is also used as the source of transitive usage requirements content. Static libraries still require users to link to all entries in their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only certain interface libraries. Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally, we need to compare the evaluated result of it with the link implementation to determine whether to issue the policy warning for static libraries. For shared libraries, the policy warning is issued if the contents of the INTERFACE_LINK_LIBRARIES property differs from the contents of the relevant config-specific old LINK_INTERFACE_LIBRARIES property.
* Error on relative path in INCLUDE_DIRECTORIES target property.Stephen Kelly2013-05-211-0/+2
| | | | | Add policy CMP0021 to preserve existing behavior in projects expecting it from earlier CMake versions.
* Automatically link to the qtmain library when linking to QtCore.Stephen Kelly2013-01-231-0/+1
| | | | | When using QAxServer, ensure that the qtmain library is excluded by reporting an error at CMake time if it is not.
* Add policy CMP0019 to skip include/link variable re-expansionBrad King2012-12-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Historically CMake has always expanded ${} variable references in the values given to include_directories(), link_directories(), and link_libraries(). This has been unnecessary since general ${} evaluation syntax was added to the language a LONG time ago, but has remained for compatibility with VERY early CMake versions. For a long time the re-expansion was a lightweight operation because it was only processed once at the directory level and the fast-path of cmMakefile::ExpandVariablesInString was usually taken because values did not have any '$' in them. Then commit d899eb71 (Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES, 2012-02-22) made the operation a bit heavier because the expansion is now needed on a per-target basis. In the future we will support generator expressions in INCLUDE_DIRECTORIES with $<> syntax, so the fast-path in cmMakefile::ExpandVariablesInString will no longer be taken and re-expansion will be very expensive. Add policy CMP0019 to skip the re-expansion altogether in NEW behavior. In OLD behavior perform the expansion but improve the fast-path heuristic to match ${} but not $<>. If the policy is not set then warn if expansion actually does anything. We expect this to be encountered very rarely in practice.
* Refactor generation of shared library flagsStephen Kelly2012-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a variety of purposes that are correlated with shared libraries but not exclusive to them. Refactor generation of these flags to use new purpose-specific platform variables CMAKE_<lang>_COMPILE_OPTIONS_DLL CMAKE_<lang>_COMPILE_OPTIONS_PIC CMAKE_<lang>_COMPILE_OPTIONS_PIE Activate the DLL flags specifically for shared libraries. Add a new POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and default to true for shared libraries to preserve default behavior. Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to allow easy global configuration in projects. Although the default behavior is unchanged by this refactoring, the new approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely. We must leave it set in case projects reference the value. Furthermore, if a project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new value to be used. Add policy CMP0018 to handle compatibility with projects that modify this platform variable. Add a PositionIndependentCode test on platforms where we can get meaningful results.
* doxygen: fix some comments in cmPolicies.hYury G. Kudryashov2012-02-291-24/+39
|
* Prefer files from CMAKE_ROOT when including from CMAKE_ROOTAlex Neundorf2011-01-041-0/+1
| | | | | | | | | | | | | | | This patch makes include() and find_package() prefer cmake files located in CMAKE_ROOT over those in CMAKE_MODULE_PATH. This makes sure that the including file gets that file included which it expects, i.e. the one from cmake with which it was tested. It only changes behaviour when such an included file exists both in CMAKE_MODULE_PATH and in CMAKE_ROOT. This comes together with a new policy CMP0017, with default behaviour it behaves as it always did, but warns. With NEW behaviour it includes the file from CMAKE_ROOT instead from CMAKE_MODULE_PATH. This fixes (if CMP0017 is set) building KDE 4.5 with cmake >= 2.8.3. Also a basic test for this policy in included.
* Allow users to specify defaults for unset policiesBrad King2011-01-041-0/+4
| | | | | | | | | | Check CMAKE_POLICY_DEFAULT_CMP<NNNN> for a default when policy CMP<NNNN> would otherwise be left unset. This allows users to set policies on the command line when the project does not set them. One may do this to quiet warnings or test whether a project will build with new behavior without modifying code. There may also be cases when users want to build an existing project release using new behavior for policies unknown to the project at the time of the release.
* New CMP0016 for deciding whether an unknown target in TLL() is an error.Alex Neundorf2010-08-281-0/+1
| | | | | | | | When set to OLD, target_link_libraries() silently accepts if it is called with only one argument and this one argument is not a target. When set to NEW, this is an error. By default it is a warning now. Alex
* Remove trailing whitespaceAlex Neundorf2010-08-281-3/+3
| | | | Alex
* Teach CMake Policies about tweak version componentBrad King2010-04-231-0/+1
| | | | | | | | Add the [.tweak] version component throughout the policy implementation. Document all components for the cmake_policy(VERSION) command. Record the tweak level in which each policy was introduced (0 for all current policies). In generated documentation we report the tweak level only if it is not zero. This preserves existing documentation.
* Teach link_directories to recognize relative pathsBrad King2009-11-241-0/+1
| | | | | | | | We create CMake Policy CMP0015 to make link_directories() treat relative paths with respect to the source tree while retaining compatibility. This makes it consistent with include_directories() and other commands. Changes based on patch from Alex. See issue #9697.
* Fix if() command and CMP0012 OLD/NEW behaviorBrad King2009-10-271-1/+1
| | | | | | | | | | | | | | The commit "modified the if command to address bug 9123 some" changed the if() command behavior with respect to named boolean constants. It introduced policy CMP0012 to provide compatibility. However, it also changed behavior with respect to numbers (like '2') but did not cover the change with the policy. Also, the behavior it created for numbers is confusing ('2' is false). This commit teaches if() to recognize numbers again, and treats them like the C language does in terms of boolean conversion. We also fix the CMP0012 check to trigger in all cases where the result of boolean coersion differs from that produced by CMake 2.6.4.
* Remove CMake Policy CMP0015 until it is revisedBrad King2009-10-081-1/+0
| | | | | | | | | | | | | | | | | | | | We revert commit "Create CMake Policy CMP0015 to fix set(CACHE)" because the NEW behavior of the policy breaks a valid use case: # CMakeLists.txt option(BUILD_SHARED_LIBS "..." ON) add_library(mylib ...) set(BUILD_SHARED_LIBS OFF) # we want only mylib to be shared add_subdirectory(ThirdParty) # ThirdParty/CMakeLists.txt option(BUILD_SHARED_LIBS "..." ON) # uh, oh, with NEW behavior this dir uses shared libs!!! We'll re-introduce the policy later with a different change in behavior to resolve the motivating case, which was more subtle but less common. See issue #9008.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* Create CMake Policy CMP0015 to fix set(CACHE)Brad King2009-09-101-0/+1
| | | | | | | | The set(CACHE) and option() commands should always expose the cache value. Previously we failed to expose the value when it was already set if a local variable definition hid it. When set to NEW, this policy tells the commands to always remove the local variable definition to expose the cache value. See issue #9008.
* Create CMP0014 to require CMakeLists.txt filesBrad King2009-09-031-0/+1
| | | | | | Until now CMake accidentally accepted add_subdirectory() and subdirs() calls referring to directories that do not contain a CMakeLists.txt file. We introduce CMake Policy CMP0014 to make this case an error.
* ENH: Create CMP0013 to disallow duplicate dirsBrad King2009-06-171-0/+1
| | | | | | | | | | | | In CMake 2.6.3 and below we silently accepted duplicate build directories whose build files would then conflict. At first this was considured purely a bug that confused beginners but would not be used in a real project. In CMake 2.6.4 we explicitly made it an error. However, some real projects took advantage of this as a "feature" and got lucky that the subtle build errors it can cause did not occur. Therefore we need a policy to deal with the case more gracefully. See issue #9173.
* ENH: modified the if command to address bug 9123 someKen Martin2009-06-121-0/+1
|
* ENH: try to fix vs6 buildBill Hoffman2009-01-231-2/+1
|
* ENH: Isolate policy changes in included scriptsBrad King2009-01-221-0/+1
| | | | | | | | Isolation of policy changes inside scripts is important for protecting the including context. This teaches include() and find_package() to imply a cmake_policy(PUSH) and cmake_policy(POP) around the scripts they load, with a NO_POLICY_SCOPE option to disable the behavior. This also creates CMake Policy CMP0011 to provide compatibility. See issue #8192.
* ENH: Refactor policy stack representationBrad King2009-01-221-0/+4
| | | | | | This defines PolicyMap as a public member of cmPolicies. Its previous role as a policy stack entry is now called PolicyStackEntry and represented as a class to which more information can be added later.
* ENH: Improve argument parsing error messagesBrad King2008-09-241-0/+1
| | | | | | | | | | | | | | Previously error messages produced by parsing of command argument variable references, such as bad $KEY{VAR} syntax or a bad escape sequence, did not provide good context information. Errors parsing arguments inside macro invocations gave no context at all. Furthermore, some errors such as a missing close curly "${VAR" would be reported but build files would still be generated. These changes teach CMake to report errors with good context information for all command argument parsing problems. Policy CMP0010 is introduced so that existing projects that built despite such errors will continue to work.
* ENH: Improve FILE GLOB_RECURSE handling of symlinks with a new CMake policy. ↵David Cole2008-09-111-0/+1
| | | | CMP0009 establishes NEW default behavior of not recursing through symlinks. OLD default behavior or explicit FOLLOW_SYMLINKS argument to FILE GLOB_RECURSE will still recurse through symlinks.
* ENH: Improve errors when a policy is REQUIREDBrad King2008-08-181-9/+7
| | | | | | In the future some policies may be set to REQUIRED_IF_USED or REQUIRED_ALWAYS. This change clarifies the error messages users receive when violating the requirements.
* ENH: Support full-path libs w/out valid names.Brad King2008-07-231-0/+1
| | | | | | | | This change introduces policy CMP0008 to decide how to treat full path libraries that do not appear to be valid library file names. Such libraries worked by accident in the VS IDE and Xcode generators with CMake 2.4 and below. We support them in CMake 2.6 by introducing this policy. See policy documentation added by this change for details.
* ENH: fix list command with empty elementsBill Hoffman2008-04-211-0/+1
|
* BUG: Fix compatibility with CMake 2.4 for installation of MACOSX_BUNDLE targetsBrad King2008-04-141-0/+1
| | | | | | - Add policy CMP0006 to decide whether to use compatibility - OLD behavior is to fall back to RUNTIME rules - NEW behavior is to produce an error
* ENH: Add policy CMP0005 to decide whether add_definitions should escape defs.Brad King2008-03-131-0/+1
|
* ENH: Add policy CMP_0004 to require library names to have no leading or ↵Brad King2008-03-131-0/+1
| | | | trailing whitespace. Replace previous check of CMAKE_BACKWARDS_COMPATIBILITY against version 2.4 with the policy.
* ENH: Convert CMAKE_LINK_OLD_PATHS to policy CMP0003.Brad King2008-03-131-0/+1
| | | | | | | | | - Policy is WARN by default so projects will build as they did in 2.4 without user intervention - Remove CMAKE_LINK_OLD_PATHS variable since it was never in a release and the policy supercedes it - Report target creation backtrace in warning message since policy should be set by that point
* ENH: change CMP_ to CMPKen Martin2008-03-131-4/+4
|
* ENH: Finish creating, documenting, and enforcing policy CMP_0002.Brad King2008-03-071-1/+5
|
* ENH: Improve handling of old-style compatibility.Brad King2008-03-071-6/+6
| | | | | | | | | | | | | | | | | | | - Remove CMP_0001 (no slash in target name) and restore old CMAKE_BACKWARDS_COMPATIBILITY check for it - Replace all checks of CMAKE_BACKWARDS_COMPATIBILITY with cmLocalGenerator::NeedBackwardsCompatibility calls - Create new CMP_0001 to determine whether or not CMAKE_BACKWARDS_COMPATIBILITY is used. (old = use, new = ignore) - Show CMAKE_BACKWARDS_COMPATIBILITY in cache only when CMP_0001 is set to OLD or WARN - Update documentation of cmake_policy and cmake_minimum_required to indicate their relationship and the 2.4 version boundary - When no cmake policy version is set in top level makefile implicitly call cmake_policy(VERSION 2.4) which restores CMAKE_BACKWARDS_COMPATIBILITY and other 2.4 compatibility - Fix tests MakeClean and Preprocess to call cmake_policy(VERSION 2.6) because they depend on new policies
* BUG: some fixes, still a few to goKen Martin2008-03-051-1/+3
|
* ENH: add --help-policies and --help-policy command line optionsKen Martin2008-03-041-0/+3
|
* COMP: possible fix for VS6, but probably not, probably need tomake it internalKen Martin2008-03-021-2/+3
|
* ENH: revert dumb changeKen Martin2008-03-021-1/+1
|
* COMP: fix compile errors on vs6 and a warningKen Martin2008-03-021-1/+1
|
* STYLE: fix some line lengthsKen Martin2008-03-011-1/+2
|
* ENH: just getting somethng checked in, still work to doKen Martin2008-02-291-0/+85