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.
The change in commit 3b95ab5693 (Performance: Improve efficiency of
source file lookup in cmMakefile, 2017-08-17) broke some legacy behavior
of source file properties in which the order sources are first resolved
with extensions affects how setting properties without extensions works.
It has been reverted for now, but the discovery was made after merging
because the broken case was not covered by our test suite.
Add a test case representing the legacy behavior.
Issue: #15208
Add SOURCE_DIR and BINARY_DIR directory properties that return the
absolute paths to the corresponding directories. These correspond
to the target properties of the same names that we already have.
Move failure cases from the CMake.{If,List,While,GetProperty} tests over
to the RunCMake.{if,list,while,get_property} tests to use the more
modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to
try to regex-match full paths.