Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake ignores toolchain file. How do get debug/error output?

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.

like image 527
Good Night Nerd Pride Avatar asked Nov 02 '11 12:11

Good Night Nerd Pride


People also ask

What is CMake toolchain file?

CMake uses a toolchain of utilities to compile, link libraries and create archives, and other tasks to drive the build. The toolchain utilities available are determined by the languages enabled. In normal builds, CMake automatically determines the toolchain for host builds based on system introspection and defaults.

What is Cmake_sysroot?

The CMAKE_SYSROOT content is passed to the compiler in the --sysroot flag, if supported. The path is also stripped from the RPATH / RUNPATH if necessary on installation. The CMAKE_SYSROOT is also used to prefix paths searched by the find_* commands.


1 Answers

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.

like image 189
Good Night Nerd Pride Avatar answered Oct 22 '22 21:10

Good Night Nerd Pride