install: Do not crash on imported global target
Since !2152 (merged) the install(TARGETS)
command may find a global-scoped target outside the calling directory. Ignore an IMPORTED GLOBAL
target if it is found in this way. Imported targets cannot be installed, and trying to do so violates internal invariants.
Fixes: #19022 (closed)