Set default toolchain system-wide

Good day. I use cmake on linux for cross-compilation. For both 32 and 64 systems i have separate “chroots”. Now I also want to add one for windows as well to compile with mingw. So the question is - can I set up mingw toolchain as default for cmake in this chroot? Just to avoid setting “-DCMAKE_TOOLCHAIN_FILE” every time

This sounds like a good case for adding a CMAKE_TOOLCHAIN_FILE environment variable.

No, please don’t unless you can specify by command line that you do NOT want to use a toolchain file. How many environment variables are we supposed to clear in setup scripts to get a well defined behavior?

This rather sounds like a simple bash alias.

1 Like