Is there a way to pass a variable to a toolchain file when invoking cmake?
For example, I have the following toolchain file:
message("FOO = ${FOO}")
I have tried the following, but it did not work. The variable is not set in the toolchain file.
cmake <src-dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain-file> -DFOO="bar" -B <build-dir>
What I am actually trying to achieve is passing a path to the toolchain file. And I can't modify the main CMakeLists.txt in .