Skip to content

cmake: Fix relative path regression in -C

Peter Waller requested to merge pwaller/cmake:fix-path-resolution into master

!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

Edited by Brad King

Merge request reports