install: Fix regression when using default destinations
In !2558 (merged), a regression was introduced, in which an install(TARGETS) with a RUNTIME/LIBRARY/ARCHIVE DESTINATION but no PUBLIC_HEADER/ PRIVATE_HEADER DESTINATION would then install the headers. The old behavior did not do this. Restore the old behavior.
Fixes: #20326 (closed)
Backport: release:HEAD^2~1
Edited by Brad King