Warning CMAKE_TOOLCHAIN_FILE not used on second run of cmake
When I run cmake (3.9.1, though I have seen this back to at least 2.8.12) more than once with a CMAKE_TOOLCHAIN_FILE, the second run I get a warning:
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
for example
rm -rf builddir
mkdir builddir
cd builddir
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/my/cross/compile/toolchain.cmake ../sourcedir
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/my/cross/compile/toolchain.cmake ../sourcedir
Note that this seems to happen only on the second run, all runs after that seem to not show this warning. (I suspect there are other sequences that can cause this issue, but I have not figured them out)
I have created a wrapper to cmake that specifies my toolchain and a bunch of other options that I used instead of directly calling cmake, thus it is my normal habit to specify this option on all runs. Since the toolchain file itself has not changed cmake should not warn about it.