cmake -S and --toolchain with relative path
$ ls
project toolchain.cmake
$ cmake -S project -B build --toolchain toolchain.cmake
CMake Error at /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:130 (message):
Could not find toolchain file: toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt:162 (project)
$ cmake --version
cmake version 3.22.2
Apparently cmake -S changes the work directory and so toolchain.cmake becomes ../toolchain.cmake. This is quite unexpected behavior and it took me a while to figure out what's going on.
Expected behavior: the above command succeeds