summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.cxx
Commit message (Collapse)AuthorAgeFilesLines
* TLL: Don't populate old link interface if CMP0022 is NEW.Stephen Kelly2013-07-081-1/+5
| | | | | | | | | | | | | Always populate the INTERFACE_LINK_LIBRARIES for interface entries. Don't populate the old interface properties matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? if CMP0022 is NEW. Because the INTERFACE_LINK_LIBRARIES property is now populated by the target_link_libraries when operating on a static library, make an equivalent change which populates the property with the same value when the old link_libraries() command is used. This silences the policy warning in that case.
* Export: Generate INTERFACE_LINK_LIBRARIES property on targets.Stephen Kelly2013-07-081-0/+5
| | | | | | | | | | This property is generated only for targets which have recorded policy CMP0022 as NEW, and a compatibility mode is added to additionally export the old interfaces in that case too. If the old interfaces are not exported, the generated export files require CMake 2.8.12. Because the unit tests use a version which is not yet called 2.8.12, temporarily require a lower version.
* Introduce the INTERFACE_LINK_LIBRARIES property.Stephen Kelly2013-07-081-0/+22
| | | | | | | | | | | | | | | | | | | | 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.
* Merge topic 'error-on-exported-missing-include-dir'Brad King2013-05-211-0/+14
|\ | | | | | | | | eabefa8 Error on relative path in INCLUDE_DIRECTORIES target property.
| * Error on relative path in INCLUDE_DIRECTORIES target property.Stephen Kelly2013-05-211-0/+14
| | | | | | | | | | Add policy CMP0021 to preserve existing behavior in projects expecting it from earlier CMake versions.
* | Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-3/+4
|/
* Automatically link to the qtmain library when linking to QtCore.Stephen Kelly2013-01-231-0/+21
| | | | | 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/+17
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Documentation: Correct typos and grammarAndreas Mohr2012-11-071-1/+1
|
* Refactor generation of shared library flagsStephen Kelly2012-06-121-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Documentation: Fix a few typos (#11883)Modestas Vainius2011-02-221-1/+1
| | | | | | | | | | | | | W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 10029: warning [p 158, 13.5i]: can't break line I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz informations information I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz dependant dependent I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz prefered preferred I: cmake: spelling-error-in-binary ./usr/bin/cmake prefered preferred I: cmake: spelling-error-in-binary ./usr/bin/cpack prefered preferred I: cmake: spelling-error-in-binary ./usr/bin/ctest prefered preferred I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakepolicies.1.gz prefered preferred I: cmake-curses-gui: spelling-error-in-binary ./usr/bin/ccmake prefered preferred I: cmake-qt-gui: spelling-error-in-binary ./usr/bin/cmake-gui prefered preferred
* Improve documentation and messages for the new CMP0017Alex Neundorf2011-01-041-8/+9
| | | | | | This patch incorporates the comments from Brad: -some improvements to the documentation of CMP0017 -make the test QUIETLY search for zlib
* Prefer files from CMAKE_ROOT when including from CMAKE_ROOTAlex Neundorf2011-01-041-0/+16
| | | | | | | | | | | | | | | 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-2/+37
| | | | | | | | | | 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.
* Fix indentation in cmPolicies::ApplyPolicyVersion()Alex Neundorf2011-01-041-14/+13
| | | | Alex
* New CMP0016 for deciding whether an unknown target in TLL() is an error.Alex Neundorf2010-08-281-0/+8
| | | | | | | | 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-23/+24
| | | | Alex
* Teach CMake Policies about tweak version componentBrad King2010-04-231-28/+51
| | | | | | | | 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/+15
| | | | | | | | 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-10/+15
| | | | | | | | | | | | | | 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-31/+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.
* Clarify documentation and message for CMP0012Brad King2009-10-021-1/+3
| | | | | | | This commit re-words the warning message produced for CMP0012 to avoid the word 'you' since often the person reading the message is not the author of the code. We also add an example of the bad OLD behavior to the policy documentation.
* Fix documentation of CMP0012 and CMP0013 versionsBrad King2009-10-021-4/+4
| | | | | | These policies were originally developed during the 2.7.x series and intended for 2.6.5. There was never a 2.6.5 release, so we should refer to 2.8.0 instead.
* Policies 14 and 15 will be first released in 2.8.0Brad King2009-09-251-2/+2
| | | | | | | CMake policies CMP0014 and CMP0015 were implemented in the development series version 2.7.x but will be first released in 2.8.0. Now that the development version number is higher than that (2.9.x) we can update their version of introduction to the actual release number.
* Document full version number with policy defaultBrad King2009-09-251-2/+1
| | | | | | In CMake Policy documentation we specify the default behavior for the current version of CMake. This commit fixes that version by reporting the full version number instead of just major and minor.
* Add parentheses around '&&' between '||' for gccBrad King2009-09-111-1/+1
| | | | | | | The GNU compiler warns about possible operator precedence mistakes and asks for explicit parentheses (-Wparentheses). We add the parentheses to silence the warning. This also fixes one real logic error in the find_package() implementation by correcting expression evaluation order.
* Create CMake Policy CMP0015 to fix set(CACHE)Brad King2009-09-101-0/+31
| | | | | | | | 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/+12
| | | | | | 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.
* Fix typo in REQUIRED_ALWAYS policy error messageBrad King2009-09-031-1/+1
|
* ENH: Improve CMP0012 doc and message formattingBrad King2009-06-171-1/+2
| | | | | | | | This fixes the CMP0012 description to have a one-line summary in the 'brief' section and the rest of the explanation in the 'full' section. It makes the warning message shorter and improves formatting of the policy documentation, especially in the HTML pages. The convention is already used by all other policies.
* ENH: Create CMP0013 to disallow duplicate dirsBrad King2009-06-171-0/+17
| | | | | | | | | | | | 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.
* COMP: fix line lengthKen Martin2009-06-151-5/+6
|
* ENH: clean up some help textKen Martin2009-06-121-4/+4
|
* ENH: modified the if command to address bug 9123 someKen Martin2009-06-121-0/+13
|
* ENH: Isolate policy changes in included scriptsBrad King2009-01-221-0/+20
| | | | | | | | 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: Improve argument parsing error messagesBrad King2008-09-241-0/+12
| | | | | | | | | | | | | | 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-1/+17
| | | | 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-95/+57
| | | | | | 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/+26
| | | | | | | | 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/+12
|
* BUG: Fix compatibility with CMake 2.4 for installation of MACOSX_BUNDLE targetsBrad King2008-04-141-0/+18
| | | | | | - 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: Allow policy CMP0000 to be set explicitlyBrad King2008-03-311-1/+9
| | | | | | | | - Message for missing cmake_minimum_required is not issued until the end of processing the top CMakeLists.txt file - During processing a cmake_policy command may set behavior - OLD behavior is to silently ignore the problem - NEW behavior is to issue an error instead of a warning
* ENH: Cleanup policy version interface presented to user.Brad King2008-03-241-0/+24
| | | | | | | - In cmake_minimum_required do not set policy version if current CMake is too old - In cmPolicies::ApplyPolicyVersion report error if version is too new or cannot be parsed
* ENH: Yet another attempt at warning for CMP0003.Brad King2008-03-211-1/+4
| | | | | | | - Give example code to avoid the warning - Make explanation more consise - Explicitly state this is for compatibility - Issue the warning for at most one target
* ENH: Improve warning about specifying a cmake versionBrad King2008-03-191-39/+39
| | | | | | | | | | - Update policy CMP0000 to require use of the command cmake_minimum_required and not cmake_policy so there is only one way to avoid it. - Explicitly specify the line users should add. - Reference policy CMP0000 only at the end. - Fix policy CMP0000 documentation to not suggest use of the cmake_policy command.
* ENH: Clarify documentation of policy CMP0000 and its relationship with ↵Brad King2008-03-131-7/+14
| | | | cmake_minimum_required.
* ENH: Add policy CMP0005 to decide whether add_definitions should escape defs.Brad King2008-03-131-0/+21
|
* ENH: Add policy CMP_0004 to require library names to have no leading or ↵Brad King2008-03-131-0/+16
| | | | 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/+61
| | | | | | | | | - 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: Reduce whitespace in policy warning/error messages.Brad King2008-03-131-2/+2
|