Possibility to promote IMPORTED target to IMPORTED GLOBAL
This is a continuation of the discussion origination in !1222 (closed), regarding the possibility to promote IMPORTED
targets to become globally visible, as if they had been created with keywords IMPORTED GLOBAL
.
During the discussion in !1222 (closed) several workarounds/solutions for the original problem of IMPORTED
libraries not being available in parent-/parallel-directories were given.
However, the idea of promoting IMPORTED
targets to becoming IMPORTED GLOBAL
targets still has its value. (E.g., This prevents creating several other helper-targets.)
One of the ideas for achieving this would be to add a new property IMPORTED_GLOBAL
(in !1222 (closed) I called it just GLOBAL
), similar to property IMPORTED
, which can only be TRUE
for IMPORTED
targets and is automatically set for IMPORTED GLOBAL
targets. Different than IMPORTED
it may not be read-only.
I even started hacking such a new property into CMake (dbahadir/cmake@9db0ceff), however, although the value can be modified it sadly does not extend the lifetime/scope of an IMPORTED
target. Something seems to be missing but I do not know where.
Anyhow, what do people think about this idea and do you have better solutions or can fix my attempt?