mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmTarget: Raise error if imported target location is not set
Previously we would synthesize <TARGET_NAME>-NOTFOUND as the location. This would then end up on the link line and cause build failures. Policy CMP0110 is added to control this behaviour. Fixes #19080, #19943.
This commit is contained in:
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.19
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
CMP0111: An imported target with a missing location fails during generation. </policy/CMP0111>
|
||||
CMP0110: add_test() supports arbitrary characters in test names. </policy/CMP0110>
|
||||
CMP0109: find_program() requires permission to execute but not to read. </policy/CMP0109>
|
||||
|
||||
|
||||
20
Help/policy/CMP0111.rst
Normal file
20
Help/policy/CMP0111.rst
Normal file
@@ -0,0 +1,20 @@
|
||||
CMP0111
|
||||
-------
|
||||
|
||||
.. versionadded:: 3.19
|
||||
|
||||
An imported target with a missing location fails during generation.
|
||||
|
||||
Prior to this the location would be generated as ``<TARGET_NAME>-NOTFOUND``,
|
||||
which would result in build failures.
|
||||
|
||||
The ``OLD`` behavior of this policy is to generate the location of an imported
|
||||
unknown, static or shared library target as ``<TARGET_NAME>-NOTFOUND`` if not
|
||||
set.
|
||||
The ``NEW`` behavior is to raise an error.
|
||||
|
||||
This policy was introduced in CMake version 3.19. CMake version |release|
|
||||
warns when the policy is not set and uses ``OLD`` behavior. Use the
|
||||
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
5
Help/release/dev/imported-target-location-required.rst
Normal file
5
Help/release/dev/imported-target-location-required.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
imported-target-location-required
|
||||
---------------------------------
|
||||
|
||||
* An imported target with a missing location now fails during generation if the
|
||||
location is used. See policy :policy:`CMP0111`.
|
||||
Reference in New Issue
Block a user