Reputation: 8500
I'm currently trying to use CMake for cross-compiling. However, CMake seems to ignore the toolchain specified by
cmake -DCMAKE_TOOLCHAIN_FILE=my-toolchain.cmake .
or
cmake . -DCMAKE_TOOLCHAIN_FILE=my-toolchain.cmake
If I omit the CMAKE_TOOLCHAIN_FILE option, the exact same Makefile is generated. Furthermore, if I deliberately give a wrong filename or insert syntax and path errors in the toolchain file, CMake doesn't bother to complain either.
Is there a way to get more error/debug output during a CMake run? The only option I could find is "--debug-output", which isn't very helpful in my case.
Upvotes: 11
Views: 13280
Reputation: 8500
My mistake. CMake always regenerated an existing build tree. By deleting CMakeCache.txt in the build directory, CMake is forced to generate a new build tree and does not ignore the CMAKE_TOOLCHAIN_FILE option anymore. See the CMake FAQ.
Upvotes: 19