cmake: Fix relative path regression in -C
!3709 (merged), fixing #19619 (closed), changed ${CMAKE_SOURCE_DIR}
to reflect the source directory. Unfortunately, this was used in the machinery for looking up paths supplied at the command line, which should obviously be relative to the $PWD
seen by the user when they enter the path.
The fix is to switch to use a full path internally, unless a full path is already specified.
Add tests for the behavior of -C
under these four circumstances:
{with -S, without -S} x {full path, relative path}
Fixes: #19827 (closed)
Topic-rename: cmake-initial-cache-relative