1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-13 22:30:25 +08:00

25 Commits

Author SHA1 Message Date
Brad King
c749982c13 cmTargetPropertyComputer: Simplify by restoring use of cmMakefile
Logically revert commit 390a7d8647 (cmTargetPropertyComputer: Implement
GetProperty without cmMakefile, 2016-10-13, v3.8.0-rc1~445^2~9).
It relied on using `cmListFileBacktrace` to get a scope in which to
look up policies.

This does remove a backtrace from `LOCATION` property errors at generate
time, but the backtrace we reported before was incorrect.  It pointed at
the addition of a target, not to the reference to the property.
2021-12-08 10:03:48 -05:00
Sean McBride
37859e3244 Source: Fix clang -Wimplicit-fallthrough warnings 2021-09-28 10:53:54 -04:00
Brad King
afb998704e Remove filtering of allowed INTERFACE library properties
Previously we disallowed use of arbitrary properties on INTERFACE
libraries.  The goal was to future-proof projects using them by not
allowing properties to be set that may affect their future inclusion in
the generated buildsystem.  In order to prepare to actually include
INTERFACE libraries in the generated buildsystem, drop the filter and
allow arbitrary properties to be set.

Issue: #19145
2020-08-03 10:04:23 -04:00
Joseph Snyder
c621839bd9 Add set_property option: DEPRECATION
Add a new property flag for a target which contains a message regarding
deprecation status.

Add a warning at "Generate" time if a linked target is marked as
deprecated.

Expand ExportImport test to ensure that new property is being set and
passed correctly.  Ensure that the message is shown during the
"Generate" step run of the ExportImport test.
2020-01-02 17:11:31 -05:00
Sebastian Holtermann
f71f7ce3f0 cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Sebastian Holtermann
8af4b31b8a cmTargetPropertyComputer: Initialize static std::unordered_set on construction 2019-06-04 18:11:19 +02:00
Brad King
73a829e078 InterfaceLibrary: Whitelist EXPORT_PROPERTIES property
Fixes: #19261
2019-05-17 09:20:04 -04:00
Avraham Shukron
a40f9083dd INTERFACE Target: allow (PUBLIC/PRIVATE)_HEADER properties
Also support installing headers on an INTERFACE library.

Signed-off-by: Avraham Shukron <avraham.shukron@gmail.com>
Fixes: #15234
2019-04-11 11:09:42 -04:00
Bruno Manganelli
cc2a5261f8 Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
2019-01-16 08:16:31 -05:00
Sebastian Lipponer
59c408d053 cmTargetPropertyComputer: whitelist 'MANUALLY_ADDED_DEPENDENCIES'. 2019-01-14 20:59:33 +01:00
Ben Boeckel
fb3c5bfdbe cmTargetPropertyComputer: whitelist custom properties
CMake's properties will never begin with an underscore or a lowercase
letter, so allow them to be set by projects.
2017-11-21 11:35:41 -05:00
Deniz Bahadir
6a3922bebe Add new target-property IMPORTED_GLOBAL.
The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong
the lifetime and scope of `IMPORTED` targets in such a way as if they
had been created with the keyword `GLOBAL` in the first place.

* It can only be set to `TRUE`. That means, a local `IMPORTED` target
  can be promoted to global scope but a global `IMPORTED` target cannot
  be degraded to local scope!
* Setting it to `TRUE` only succeeds if done from within the same
  directory in which the `IMPORTED` target was created in the first
  place.

Fixes #17256.
2017-11-07 15:08:41 +01:00
Brad King
2de0e0fdfa Do not initialize NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
The change in commit v3.8.0-rc1~276^2 (Allow NO_SYSTEM_FROM_IMPORTED on
imported INTERFACE libraries, 2016-11-21) was incorrect.  The property
is not meant to be set on imported targets at all.  It is meant to be
set on their consumers that compile sources.  Since INTERFACE libraries
have no sources to compile, the property is not needed on them.

Revert most of that change.  Unfortunately we must still tolerate
project code setting NO_SYSTEM_FROM_IMPORTED on INTERFACE libraries
because they were allowed by CMake 3.8 and 3.9.

Issue: #17348
2017-10-13 14:32:14 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Daniel Pfeifer
cbcfb79f9c Use C++11 unordered containers 2017-08-22 23:05:27 +02:00
Brad King
460052516f Allow NO_SYSTEM_FROM_IMPORTED on imported INTERFACE libraries
Imported INTERFACE libraries can specify include directories via
`INTERFACE_INCLUDE_DIRECTORIES` so the default behavior of treating them
as system include directories applies.  Allow users to turn this off by
setting `NO_SYSTEM_FROM_IMPORTED` on such targets.

Closes: #16443
2016-11-21 11:42:01 -05:00
Brad King
453df662ba Merge topic 'imported-interface-libname'
09cda9d5 Allow imported INTERFACE libraries to specify a link library name
1d1f1eeb cmTarget: Refactor GetMappedConfig to choose location property up front
479932fa cmTarget: Add comment clarifying interface library special case
925e4270 cmTarget: Clarify comments in GetMappedConfig
2016-11-09 09:49:49 -05:00
Brad King
09cda9d5e7 Allow imported INTERFACE libraries to specify a link library name
Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library
name to be placed on the link line in place of an interface library
since it has no library file of its own.  Restrict use of the property
to imported `INTERFACE` libraries.

This will be particularly useful for find modules that need to provide
imported libraries from system SDKs where the full path to the library
file is not known.  Now such find modules will be able to provide an
imported interface library and set `IMPORTED_LIBNAME` to refer to the
SDK library by name.

Issue: #15267
2016-11-09 09:45:14 -05:00
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Daniel Pfeifer
c15dc19728 Introduce CM_UNORDERED_SET
Avoid duplicating switch among std::unordered_set, cmsys::hash_set, and
std::set.
2016-10-24 22:34:52 +02:00
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02:00
Stephen Kelly
848ae2a663 cmTargetPropertyComputer: Template some methods on the Target
Implement the methods for cmTarget in the cmTarget source.
2016-10-15 11:14:21 +02:00
Stephen Kelly
637e3f3ee1 cmTargetPropertyComputer: Unify whitelist handling from cmTarget 2016-10-15 11:14:21 +02:00
Stephen Kelly
05251e6d80 cmTargetPropertyComputer: Move whitelist check from cmTarget 2016-10-15 11:14:21 +02:00
Stephen Kelly
fbf1721c94 cmTargetPropertyComputer: Extract into new files 2016-10-15 11:14:21 +02:00