Previously, `install(TARGETS)` would only accept targets created in the same directory scope. Relax this restriction by searching the global scope when determining whether or not a target exists. Fixes: #14444