diff options
author | Peter Waller <p@pwaller.net> | 2019-10-11 19:48:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-14 20:17:00 (GMT) |
commit | c9d73b26b0a78fac774a549de41eee55ed4e8d7b (patch) | |
tree | d7fbd0a006240f40c825f07ef5e321272cb5c6ae /Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt | |
parent | 9150c818b7d2afb868575fcb2e0c9ba62b9d7f85 (diff) | |
download | CMake-c9d73b26b0a78fac774a549de41eee55ed4e8d7b.zip CMake-c9d73b26b0a78fac774a549de41eee55ed4e8d7b.tar.gz CMake-c9d73b26b0a78fac774a549de41eee55ed4e8d7b.tar.bz2 |
cmake: Fix relative path regression in -C
Since commit 4ca0526f8a (cmake: Pass -S and -B into PreLoad.cmake and -C
scripts, 2019-08-20, v3.16.0-rc1~195^2) the value of `CMAKE_SOURCE_DIR`
is the source directory rather than the current working directory.
This was correct on its own, but the place storing that value is also
used as the base for relative paths specified on the command line.
The latter should of course be relative to the current working
directory.
The fix is to switch to use a full path internally, unless a full path
is already specified. Add tests for the behaviour of `-C` under these
four circumstances:
{with -S, without -S} x {full path, relative path}
Fixes: #19827
Diffstat (limited to 'Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt')
-rw-r--r-- | Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt b/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt new file mode 100644 index 0000000..f382a01 --- /dev/null +++ b/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt @@ -0,0 +1,4 @@ +initial-cache.txt: CMAKE_SOURCE_DIR: .*/Tests/RunCMake/CommandLine +initial-cache.txt: CMAKE_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic_fullpath-build +CMakeLists.txt: INITIAL_SOURCE_DIR: .*/Tests/RunCMake/CommandLine +CMakeLists.txt: INITIAL_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic_fullpath-build |