export: Do not fail generation for namelink-only case
The situation described in #17925 (closed) can happen sometimes:
You are calling the install(TARGETS ...)
command with the NAMELINK_ONLY
option which associates itself with an export file and a later following install(EXPORT ...)
command call for that export file. However, due to some conditional processing of the CMakeLists.txt
files possibly no other installed files/targets are associated with that same export file.
As a result CMake will complain during generation that this export file is unknown (which itself is a misleading error-message).
This MR enables CMake to no longer write that (erroneous) error-message in this specific situation and to successfully finish generation.
When installing the component that was associated with such an export file all associated files including the name-link will be installed.
Fixes: #17925 (closed)
Backport: release
Topic-rename: export-namelink-only