• Peter Waller's avatar
    cmake: Fix relative path regression in -C · c9d73b26
    Peter Waller authored
    Since commit 4ca0526f (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
    c9d73b26
Name
Last commit
Last update
..
BuildDir Loading commit data...
C_buildsrcdir Loading commit data...
EnvGenerator Loading commit data...
ExplicitDirs Loading commit data...
cache-bad-entry Loading commit data...
cache-bad-generator Loading commit data...
cache-empty-entry Loading commit data...
cache-no-generator Loading commit data...
cmake_depends Loading commit data...
compare_files Loading commit data...
copy_input Loading commit data...
dir-install-options-to-vars Loading commit data...
B-no-arg-result.txt Loading commit data...
B-no-arg-stderr.txt Loading commit data...
B-no-arg2-result.txt Loading commit data...
B-no-arg2-stderr.txt Loading commit data...
Build-ninja-v-stdout.txt Loading commit data...
Build.cmake Loading commit data...
BuildDir--build--parallel-bad-number-result.txt Loading commit data...
BuildDir--build--parallel-bad-number-stderr.txt Loading commit data...
BuildDir--build--parallel-good-number-stderr.txt Loading commit data...
BuildDir--build--parallel-good-number-trailing--target-stderr.txt Loading commit data...
BuildDir--build--parallel-large-result.txt Loading commit data...
BuildDir--build--parallel-large-stderr.txt Loading commit data...
BuildDir--build--parallel-no-number-stderr.txt Loading commit data...
BuildDir--build--parallel-no-number-trailing--target-stderr.txt Loading commit data...
BuildDir--build--parallel-no-space-bad-number-result.txt Loading commit data...
BuildDir--build--parallel-no-space-bad-number-stderr.txt Loading commit data...
BuildDir--build--parallel-no-space-good-number-stderr.txt Loading commit data...
BuildDir--build--parallel-no-space-good-number-trailing--target-stderr.txt Loading commit data...
BuildDir--build--parallel-zero-result.txt Loading commit data...
BuildDir--build--parallel-zero-stderr.txt Loading commit data...
BuildDir--build-jobs-bad-number-result.txt Loading commit data...
BuildDir--build-jobs-bad-number-stderr.txt Loading commit data...
BuildDir--build-jobs-good-number-stderr.txt Loading commit data...
BuildDir--build-jobs-good-number-trailing--target-stderr.txt Loading commit data...
BuildDir--build-jobs-large-result.txt Loading commit data...
BuildDir--build-jobs-large-stderr.txt Loading commit data...
BuildDir--build-jobs-no-number-stderr.txt Loading commit data...
BuildDir--build-jobs-no-number-trailing--target-stderr.txt Loading commit data...
BuildDir--build-jobs-no-space-bad-number-result.txt Loading commit data...
BuildDir--build-jobs-no-space-bad-number-stderr.txt Loading commit data...
BuildDir--build-jobs-no-space-good-number-stderr.txt Loading commit data...
BuildDir--build-jobs-no-space-good-number-trailing--target-stderr.txt Loading commit data...
BuildDir--build-jobs-zero-result.txt Loading commit data...
BuildDir--build-jobs-zero-stderr.txt Loading commit data...
BuildDir--build-multiple-targets-jobs-stderr.txt Loading commit data...
BuildDir--build-multiple-targets-with-clean-first-result.txt Loading commit data...
BuildDir--build-multiple-targets-with-clean-first-stderr.txt Loading commit data...
BuildDir--build-multiple-targets-with-clean-second-result.txt Loading commit data...
BuildDir--build-multiple-targets-with-clean-second-stderr.txt Loading commit data...
BuildDir.cmake Loading commit data...
C-no-arg-result.txt Loading commit data...
C-no-arg-stderr.txt Loading commit data...
C-no-file-result.txt Loading commit data...
C-no-file-stderr.txt Loading commit data...
CMakeLists.txt Loading commit data...
C_basic-stderr.txt Loading commit data...
C_basic-stdout.txt Loading commit data...
C_basic.cmake Loading commit data...
C_basic_fullpath-stderr.txt Loading commit data...
C_basic_fullpath-stdout.txt Loading commit data...
C_basic_fullpath.cmake Loading commit data...
C_basic_initial-cache.txt Loading commit data...
C_buildsrcdir-stderr.txt Loading commit data...
C_buildsrcdir-stdout.txt Loading commit data...
C_buildsrcdir.cmake Loading commit data...
Cno-file-result.txt Loading commit data...
Cno-file-stderr.txt Loading commit data...
D-no-arg-result.txt Loading commit data...
D-no-arg-stderr.txt Loading commit data...
D-no-src-result.txt Loading commit data...
D-no-src-stderr.txt Loading commit data...
D_nested_cache-stderr.txt Loading commit data...
D_nested_cache.cmake Loading commit data...
D_typed_nested_cache-stderr.txt Loading commit data...
D_typed_nested_cache.cmake Loading commit data...
Dno-src-result.txt Loading commit data...
Dno-src-stderr.txt Loading commit data...
E-no-arg-result.txt Loading commit data...
E-no-arg-stderr.txt Loading commit data...
E___run_co_compile-bad-iwyu-result.txt Loading commit data...
E___run_co_compile-bad-iwyu-stderr.txt Loading commit data...
E___run_co_compile-no----result.txt Loading commit data...
E___run_co_compile-no----stderr.txt Loading commit data...
E___run_co_compile-no-cc-result.txt Loading commit data...
E___run_co_compile-no-cc-stderr.txt Loading commit data...
E___run_co_compile-no-iwyu-result.txt Loading commit data...
E___run_co_compile-no-iwyu-stderr.txt Loading commit data...
E_capabilities-arg-result.txt Loading commit data...
E_capabilities-arg-stderr.txt Loading commit data...
E_capabilities-stdout.txt Loading commit data...
E_compare_files-different-eol-result.txt Loading commit data...
E_compare_files-different-eol-stderr.txt Loading commit data...
E_compare_files-ignore-eol-nonexistent-result.txt Loading commit data...
E_compare_files-ignore-eol-nonexistent-stderr.txt Loading commit data...
E_copy-one-source-directory-target-is-directory-result.txt Loading commit data...
E_copy-one-source-directory-target-is-directory-stderr.txt Loading commit data...
E_copy-one-source-file-result.txt Loading commit data...
E_copy-one-source-file-stderr.txt Loading commit data...
E_copy-three-source-files-target-is-directory-result.txt Loading commit data...
E_copy-three-source-files-target-is-directory-stderr.txt Loading commit data...
E_copy-three-source-files-target-is-file-result.txt Loading commit data...
E_copy-three-source-files-target-is-file-stderr.txt Loading commit data...
E_copy-two-good-and-one-bad-source-files-target-is-directory-result.txt Loading commit data...
E_copy-two-good-and-one-bad-source-files-target-is-directory-stderr.txt Loading commit data...
E_copy_directory-three-source-files-target-is-directory-result.txt Loading commit data...
E_copy_directory-three-source-files-target-is-directory-stderr.txt Loading commit data...
E_copy_directory-three-source-files-target-is-file-result.txt Loading commit data...
E_copy_directory-three-source-files-target-is-file-stderr.txt Loading commit data...
E_copy_directory-three-source-files-target-is-not-exist-result.txt Loading commit data...
E_copy_directory-three-source-files-target-is-not-exist-stderr.txt Loading commit data...
E_copy_if_different-one-source-directory-target-is-directory-result.txt Loading commit data...
E_copy_if_different-one-source-directory-target-is-directory-stderr.txt Loading commit data...
E_copy_if_different-three-source-files-target-is-directory-result.txt Loading commit data...
E_copy_if_different-three-source-files-target-is-directory-stderr.txt Loading commit data...
E_copy_if_different-three-source-files-target-is-file-result.txt Loading commit data...
E_copy_if_different-three-source-files-target-is-file-stderr.txt Loading commit data...
E_create_symlink-broken-create-check.cmake Loading commit data...
E_create_symlink-broken-replace-check.cmake Loading commit data...
E_create_symlink-missing-dir-result.txt Loading commit data...
E_create_symlink-missing-dir-stderr.txt Loading commit data...
E_create_symlink-no-arg-result.txt Loading commit data...
E_create_symlink-no-arg-stderr.txt Loading commit data...
E_create_symlink-no-replace-dir-result.txt Loading commit data...
E_create_symlink-no-replace-dir-stderr.txt Loading commit data...
E_env-bad-arg1-result.txt Loading commit data...
E_env-bad-arg1-stderr.txt Loading commit data...
E_env-no-command0-result.txt Loading commit data...
E_env-no-command0-stderr.txt Loading commit data...
E_env-no-command1-result.txt Loading commit data...
E_env-no-command1-stderr.txt Loading commit data...
E_env-set-stdout.txt Loading commit data...
E_env-set.cmake Loading commit data...
E_env-unset-stdout.txt Loading commit data...
E_env-unset.cmake Loading commit data...
E_false-extraargs-result.txt Loading commit data...
E_false-result.txt Loading commit data...
E_make_directory-directory-with-parent-check.cmake Loading commit data...
E_make_directory-directory-with-parent-result.txt Loading commit data...
E_make_directory-directory-with-parent-stderr.txt Loading commit data...
E_make_directory-three-directories-check.cmake Loading commit data...
E_make_directory-three-directories-result.txt Loading commit data...
E_make_directory-three-directories-stderr.txt Loading commit data...
E_make_directory-two-directories-and-file-result.txt Loading commit data...
E_make_directory-two-directories-and-file-stderr.txt Loading commit data...
E_md5sum-dir-result.txt Loading commit data...
E_md5sum-dir-stderr.txt Loading commit data...
E_md5sum-mixed-result.txt Loading commit data...
E_md5sum-mixed-stderr.txt Loading commit data...
E_md5sum-mixed-stdout.txt Loading commit data...
E_md5sum-no-file-result.txt Loading commit data...
E_md5sum-no-file-stderr.txt Loading commit data...
E_md5sum-result.txt Loading commit data...
E_md5sum-stdout.txt Loading commit data...
E_remove_directory-directory-with-parent-check.cmake Loading commit data...
E_remove_directory-directory-with-parent-stderr.txt Loading commit data...
E_remove_directory-symlink-dir-check.cmake Loading commit data...
E_remove_directory-symlink-dir-stderr.txt Loading commit data...
E_remove_directory-symlink-file-check.cmake Loading commit data...
E_remove_directory-symlink-file-stderr.txt Loading commit data...
E_remove_directory-three-directories-check.cmake Loading commit data...
E_remove_directory-three-directories-stderr.txt Loading commit data...
E_remove_directory-two-directories-and-file-check.cmake Loading commit data...
E_remove_directory-two-directories-and-file-stderr.txt Loading commit data...
E_rename-no-arg-result.txt Loading commit data...
E_rename-no-arg-stderr.txt Loading commit data...
E_server-arg-result.txt Loading commit data...
E_server-arg-stderr.txt Loading commit data...
E_server-pipe-result.txt Loading commit data...
E_server-pipe-stderr.txt Loading commit data...
E_sha1sum-dir-result.txt Loading commit data...
E_sha1sum-dir-stderr.txt Loading commit data...
E_sha1sum-no-file-result.txt Loading commit data...
E_sha1sum-no-file-stderr.txt Loading commit data...
E_sha1sum-result.txt Loading commit data...
E_sha1sum-stdout.txt Loading commit data...
E_sha224sum-dir-result.txt Loading commit data...
E_sha224sum-dir-stderr.txt Loading commit data...
E_sha224sum-no-file-result.txt Loading commit data...
E_sha224sum-no-file-stderr.txt Loading commit data...
E_sha224sum-result.txt Loading commit data...
E_sha224sum-stdout.txt Loading commit data...
E_sha256sum-dir-result.txt Loading commit data...
E_sha256sum-dir-stderr.txt Loading commit data...
E_sha256sum-no-file-result.txt Loading commit data...
E_sha256sum-no-file-stderr.txt Loading commit data...
E_sha256sum-result.txt Loading commit data...
E_sha256sum-stdout.txt Loading commit data...
E_sha384sum-dir-result.txt Loading commit data...
E_sha384sum-dir-stderr.txt Loading commit data...
E_sha384sum-no-file-result.txt Loading commit data...
E_sha384sum-no-file-stderr.txt Loading commit data...
E_sha384sum-result.txt Loading commit data...
E_sha384sum-stdout.txt Loading commit data...
E_sha512sum-dir-result.txt Loading commit data...
E_sha512sum-dir-stderr.txt Loading commit data...
E_sha512sum-no-file-result.txt Loading commit data...
E_sha512sum-no-file-stderr.txt Loading commit data...
E_sha512sum-result.txt Loading commit data...
E_sha512sum-stdout.txt Loading commit data...
E_sleep-bad-arg1-result.txt Loading commit data...
E_sleep-bad-arg1-stderr.txt Loading commit data...
E_sleep-bad-arg2-result.txt Loading commit data...
E_sleep-bad-arg2-stderr.txt Loading commit data...
E_sleep-no-args-result.txt Loading commit data...
E_sleep-no-args-stderr.cmake Loading commit data...
E_time-no-arg-result.txt Loading commit data...
E_time-no-arg-stderr.txt Loading commit data...
E_time-stdout.txt Loading commit data...
E_touch-nonexistent-dir-result.txt Loading commit data...
E_touch-nonexistent-dir-stderr.txt Loading commit data...
E_touch_nocreate-no-arg-result.txt Loading commit data...
E_touch_nocreate-no-arg-stderr.txt Loading commit data...
Envgen-A-platform-result.txt Loading commit data...
Envgen-A-platform-stderr-vs9.txt Loading commit data...
Envgen-A-platform-stderr.txt Loading commit data...
Envgen-G-implicit-platform-stdout.txt Loading commit data...
Envgen-T-toolset-result.txt Loading commit data...
Envgen-T-toolset-stderr.txt Loading commit data...
Envgen-bad-result.txt Loading commit data...
Envgen-bad-stderr.txt Loading commit data...
Envgen-instance-invalid-result.txt Loading commit data...
Envgen-instance-invalid-stderr.txt Loading commit data...
Envgen-ninja-result.txt Loading commit data...
Envgen-ninja-stderr.txt Loading commit data...
Envgen-platform-invalid-result.txt Loading commit data...
Envgen-platform-invalid-stderr-vs9.txt Loading commit data...
Envgen-platform-invalid-stderr.txt Loading commit data...
Envgen-toolset-invalid-result.txt Loading commit data...
Envgen-toolset-invalid-stderr.txt Loading commit data...
Envgen-unset-result.txt Loading commit data...
Envgen-unset-stderr.txt Loading commit data...
Envgen-warnings-result.txt Loading commit data...
Envgen-warnings-stderr.txt Loading commit data...
G_bad-arg-result.txt Loading commit data...
G_bad-arg-stderr.txt Loading commit data...
G_no-arg-result.txt Loading commit data...
G_no-arg-stderr.txt Loading commit data...
NoArgs-stdout.txt Loading commit data...
P_directory-result.txt Loading commit data...
P_directory-stderr.txt Loading commit data...
P_no-arg-result.txt Loading commit data...
P_no-arg-stderr.txt Loading commit data...
P_no-file-result.txt Loading commit data...
P_no-file-stderr.txt Loading commit data...
P_working-dir.cmake Loading commit data...
RunCMakeTest.cmake Loading commit data...
S-no-arg-result.txt Loading commit data...
S-no-arg-stderr.txt Loading commit data...
S-no-arg2-result.txt Loading commit data...
S-no-arg2-stderr.txt Loading commit data...
U-no-arg-result.txt Loading commit data...
U-no-arg-stderr.txt Loading commit data...
U-no-src-result.txt Loading commit data...
U-no-src-stderr.txt Loading commit data...
Uno-src-result.txt Loading commit data...
Uno-src-stderr.txt Loading commit data...
W_bad-arg1-result.txt Loading commit data...
W_bad-arg1-stderr.txt Loading commit data...
W_bad-arg2-result.txt Loading commit data...
W_bad-arg2-stderr.txt Loading commit data...
W_bad-arg3-result.txt Loading commit data...
W_bad-arg3-stderr.txt Loading commit data...
Wdeprecated-stderr.txt Loading commit data...
Wdeprecated.cmake Loading commit data...
Wdev-stderr.txt Loading commit data...
Wdev.cmake Loading commit data...
Werror_deprecated-result.txt Loading commit data...
Werror_deprecated-stderr.txt Loading commit data...
Werror_deprecated.cmake Loading commit data...
Werror_dev-result.txt Loading commit data...
Werror_dev-stderr.txt Loading commit data...
Werror_dev.cmake Loading commit data...
Wizard-result.txt Loading commit data...
Wizard-stderr.txt Loading commit data...
Wno-deprecated.cmake Loading commit data...
Wno-dev.cmake Loading commit data...
Wno-error_deprecated-stderr.txt Loading commit data...
Wno-error_deprecated.cmake Loading commit data...
Wno-error_dev-stderr.txt Loading commit data...
Wno-error_dev.cmake Loading commit data...
build-bad-dir-result.txt Loading commit data...
build-bad-dir-stderr.txt Loading commit data...
build-bad-generator-result.txt Loading commit data...
build-bad-generator-stderr.txt Loading commit data...
build-no-cache-result.txt Loading commit data...
build-no-cache-stderr.txt Loading commit data...
build-no-dir-result.txt Loading commit data...
build-no-dir-stderr.txt Loading commit data...
build-no-generator-result.txt Loading commit data...
build-no-generator-stderr.txt Loading commit data...
cache-bad-entry-result.txt Loading commit data...
cache-bad-entry-stderr.txt Loading commit data...
cache-empty-entry-result.txt Loading commit data...
cache-empty-entry-stderr.txt Loading commit data...
cache-no-file-result.txt Loading commit data...
cache-no-file-stderr.txt Loading commit data...
cmake_depends-check.cmake Loading commit data...
cmake_depends-stdout.txt Loading commit data...
debug-output-stdout.txt Loading commit data...
debug-output.cmake Loading commit data...
debug-trycompile.cmake Loading commit data...
install-bad-dir-result.txt Loading commit data...
install-bad-dir-stderr.txt Loading commit data...
install-no-dir-result.txt Loading commit data...
install-no-dir-stderr.txt Loading commit data...
install-options-to-vars-result.txt Loading commit data...
install-options-to-vars-stderr.txt Loading commit data...
lists-no-file-result.txt Loading commit data...
lists-no-file-stderr.txt Loading commit data...
no-S-B-stderr.txt Loading commit data...
reject_fifo-result.txt Loading commit data...
reject_fifo-stderr.txt Loading commit data...
trace-expand-stderr.txt Loading commit data...
trace-expand-warn-uninitialized-stderr.txt Loading commit data...
trace-expand-warn-uninitialized.cmake Loading commit data...
trace-expand.cmake Loading commit data...
trace-only-this-file.cmake Loading commit data...
trace-redirect-check.cmake Loading commit data...
trace-redirect-nofile-result.txt Loading commit data...
trace-redirect-nofile-stderr.txt Loading commit data...
trace-redirect-nofile.cmake Loading commit data...
trace-redirect-stdout.txt Loading commit data...
trace-redirect.cmake Loading commit data...
trace-source-stderr.txt Loading commit data...
trace-source.cmake Loading commit data...
trace-stderr.txt Loading commit data...
trace.cmake Loading commit data...
warn-uninitialized-stderr.txt Loading commit data...
warn-uninitialized.cmake Loading commit data...