summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0022
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate compatibility with CMake versions older than 2.8.12Brad King2020-06-188-1/+51
| | | | | | | | Issue a deprecation warning on calls to `cmake_minimum_required` or `cmake_policy` that set policies based on versions older than 2.8.12. Note that the effective policy version includes `...<max>` treatment. This is important in combination with commit ca24b70d31 (Export: Specify a policy range in exported files, 2020-05-16, v3.18.0-rc1~133^2).
* Tests: Fix RunCMake.CMP0022 tll case for Debug configurationBrad King2017-05-182-2/+4
| | | | | | | | | | | The `CMP0022-WARN-tll` case overrides legacy properties set by `target_link_libraries` so that we can verify that the policy warning is emitted. When building in the Debug configuration, the `_DEBUG` variant of the legacy property is set/checked too. Fix the test case to override both variants. Previously it only passed because `cmComputeTargetDepends::AddInterfaceDepends` always evaluated dependencies with the "" configuration.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1/+1
| | | | | | | | | | | | | 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.
* RunCMake: Remove unneeded files.Stephen Kelly2015-02-096-6/+0
| | | | | The default expectation of RunCMake tests is empty content, so there is no need to specify it.
* OS X: Add CMP0042 to enable MACOSX_RPATH by defaultClinton Stimpson2014-01-022-0/+4
| | | | | Also adding documentation for CMAKE_MACOSX_RPATH, and improving documentation for MACOSX_RPATH.
* Genex: Add a test for the LINK_ONLY expression.Stephen Kelly2013-11-064-5/+17
| | | | | | | | | | | | | | Commit 239b0c6b (Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES., 2013-10-20) extended a test which excercised the logic of the LINK_ONLY generator expression. Commit ef10b87c (CMP0022: Plain target_link_libraries must populate link interface, 2013-11-02) removed the instance of LINK_ONLY which was excercised by that test. Add a new test which excercises the other instance of LINK_ONLY by setting the CMP0022 policy to NEW and consuming the contents of the INTERFACE_LINK_LIBRARIES target property.
* Merge branch 'policy-CMP0022-fixes' into policy-CMP0022-fixes-for-masterBrad King2013-11-0313-12/+50
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve conflict in Source/cmTarget.cxx by integrating the changes to the internal copy constructor from both sides. Also resolve a logical conflict by dropping the special case for INTERFACE_LIBRARY targets. Since cmTarget::SetMakefile already forces CMP0022 to NEW for such targets we need no special handling. Resolve conflict in Source/cmTargetLinkLibrariesCommand.h by dropping the documentation change. We will make the same change in the new location of the same documentation in a separate commit. Resolve conflicts in Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt Tests/RunCMake/CMP0022/RunCMakeTest.cmake by taking the side from the 'policy-CMP0022-fixes' branch.
| * CMP0022: Warn about a given target at most onceBrad King2013-11-036-1/+16
| | | | | | | | | | | | | | | | | | | | | | Since cmTarget::ComputeLinkInterface is called separately for each "head" target that links a target, the warning we produce when CMP0022 is not set could be repeated. Add explicit logic to allow the warning to appear at most once. Multiple copies of the warning for the same target are almost always identical and therefore redundant. In the rare case that two copies of the warning are different, the second can appear in a future run after the first is fixed.
| * Do not export INTERFACE_LINK_LIBRARIES from non-linkable targetsBrad King2013-11-023-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cmExportFileGenerator::SetImportLinkInterface exports the old LINK_INTERFACE_LIBRARIES property values it skips doing so for non-linkable targets because target->GetLinkInterface returns NULL for such targets. Since cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty looks at the INTERFACE_LINK_LIBRARIES property directly instead of using the computed link interface, teach it to skip exporting the property if target->IsLinkable returns false. Extend the RunCMake.CMP0022 test with a case covering this. Simply export an executable target that links to a library that is not exported.
| * CMP0022: Plain target_link_libraries must populate link interfaceBrad King2013-11-027-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CMP0022 NEW behavior is that the INTERFACE_LINK_LIBRARIES property exactly defines the link interface. The plain target_link_libraries signature says linking is transitive by default, so it should populate the property. Teach the target_link_libraries plain signature to populate the INTERFACE_LINK_LIBRARIES regardless of the CMP0022 setting. Refactor the cmTarget::ComputeLinkInterface checks that warn when the policy is not set to compare the new property to either the explicitly set old link interface properties or the link implementation fallback for all linkable target types, not just static libraries. This fixes a regression in 2.8.12.0 that caused target_link_libraries to not implement transitive linking in the plain signature once the policy CMP0022 is set to NEW.
| * CMP0022: Add unit test for null pointer check and message.Stephen Kelly2013-11-024-0/+29
| |
| * Merge branch 'output-CMP0022-entries' into policy-CMP0022-fixesBrad King2013-11-021-0/+9
| |\
* | \ Merge topic 'fix-tll-static-private'Brad King2013-10-261-1/+5
|\ \ \ | |/ / | | | | | | | | | 239b0c6 Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.
| * | Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.Stephen Kelly2013-10-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only valid target names or generator expressions may appear in the target field of a LINK_ONLY expression. Other content like link flags should still be added to that property (wrapped in config-specific generator expressions), but not wrapped in LINK_ONLY. Otherwise undue warnings would be issued for the policy CMP0022. The LINK_ONLY expression only has an effect for actual target names anyway, so there is no logical deficit.
* | | Merge topic 'output-CMP0022-entries'Brad King2013-10-231-0/+9
|\ \ \ | | |/ | |/| | | | | | | 0b3b336 CMP0022: Output link interface mismatch for static library warning
| * | CMP0022: Output link interface mismatch for static library warningStephen Kelly2013-10-231-0/+9
| |/ | | | | | | | | | | Other warnings for the same policy already have similar output since commit 81d2793e (Add differing target property content to policy CMP0022 warning, 2013-09-11).
* | CMP0022: Add unit test for null pointer check and message.Stephen Kelly2013-10-164-0/+29
| |
* | export(): Process the export() command at generate time.Stephen Kelly2013-10-111-1/+1
|/ | | | | | | | | | | | Make the API for adding targets string based so that it can easily use cmGeneratorTarget. Teach the cmIncludeCommand to generate the exported file at configure-time instead if it is to be include()d. The RunCMake.ExportWithoutLanguage test now needs a dummy header.h file as expected error from export() is now reported after the missing file error.
* Add differing target property content to policy CMP0022 warningStephen Kelly2013-09-112-0/+18
| | | | | List the contents of the INTERFACE_LINK_LIBRARIES and the old-style property.
* Export: Fix typo of LINK_INTERFACE_LIBRARIES.Stephen Kelly2013-07-262-2/+2
| | | | Refer correctly to the old property, not the new one.
* TLL: Don't populate old link interface if CMP0022 is NEW.Stephen Kelly2013-07-089-0/+41
| | | | | | | | | | | | | 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-087-0/+35
| | | | | | | | | | 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-0813-0/+68
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.