while executing cmake command it gives me the following error
“Current working directory cannot be established.”
I have executed cmake command from the shell script.
rm -rf build && mkdir -p build && cd build &&
cmake -DCMAKE_TOOLCHAIN_FILE=…/toolchain.cmake … 2>> output_file.txt && make clean && make 2>> output_file.txt && cd …
I am asking for capturing compile-time error logs in the file.
For example, if I use the “make” command to compile my code then the "make 2>> output_file.txt" command will store error logs in the output_file.txt file.
So how we can do the same with cmake --build command.
2>> is not specific to make, you can use it with any command that outputs to stderr.
Thus cmake --build build --config Release 2>> output_file.txt should be close to what you want.