cmake (1) --toolchain relative to -S path and not in cwd
I think this bug existed since cmake(1) --toolchain feature was added, or at least in CMake 3.26 and 3.28 on Linux and Windows.
Expected: cmake -S <src> --toolchain <path>
is not impacted by <src>
.
Bug: the --toolchain <path>
is relative to <src>
if is not absolute and not in cwd.
Specifically these argument forms of --toolchain
fail if -S <src>
is specified not as .
and toolchain file is not in cwd.
cmake -S anywhere --toolchain ./a/mytool.cmake
cmake -S anywhere --toolchain a/mytool.cmake
works
If I am in a cwd such that the toolchain is at ../mytool.cmake
that works:
cmake -S anywhere --toolchain ../mytool.cmake
# if that is the relative path to mytool.cmake
This also works
cmake -S . --toolchain a/mytool.cmake
#or
cmake --toolchain a/mytool.cmake
Edited by scivision