Skip to content
  • Peter Waller's avatar
    cmake: Fix relative path regression in -C · c9d73b26
    Peter Waller authored and Brad King's avatar Brad King committed
    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