Skip to content
DeHecht edited this page Feb 21, 2019 · 3 revisions

How to setup selectable toolchain files for cross-compiling

CMake has support for toolchain files, that can be used to easily setup CMake projects for a different compiler. Checkout CMake toolchains for more information about CMake Toolchains.

The plugin supports multiple toolchain files, but it requires a little configuration to be able to find your files. Initially the context menu looks like the following:

No Toolchains

The plugin requires all toolchain files to be located within the same directory with the naming pattern "toolchain..cmake". The name will then be displayed in the context menu. So if you have a directory with two files

  • toolchain.arm-linux-gnueabihf.cmake
  • toolchain.host.cmake

The context menu will look like the following: Two Toolchains

The path to this directory can be specified within the path preferences: Path Preferences

If correctly setup, you can switch between the toolchains and build cross compile binaries easily.