ExternalProject: Restore driving install through build system
Revert !7655 (merged). It changed the ExternalProject install step command from:
cmake --build <dir> --target install --config <cfg>
to:
cmake --install <dir> --config <cfg>
The latter command no longer runs the external project build system during the install step. We could consider using the commands:
cmake --build <dir> --target all --config <cfg>
cmake --install <dir> --config <cfg>
as the install step, but if CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
is
used in the external project, that can change semantics too.
Revert the original change pending further investigation on other ways to support its motivating use case. Add a test covering the previously-regressed use case.
Fixes: #24567 (closed)
Issue: #23946
Backport: release