cmake: Prefer -S paths over other provided paths

Merged Robert Maynard requested to merge robertmaynard/cmake:handle_multiple_source_dirs into master

When cmake parses cmake -S <path> <path> treat the second path as the build directory. Likwise when invoked with <path> -S <path> treat the first path as the build path instead of using the current working directory.

Issue: #23110 (closed)

Edited by Brad King

Merge request reports