Custom toolchain and platform files

Hi community,

we use a number of embedded toolchains and compilers for which we need to craft toolchain files for use with CMake. Most of them are deeply embedded (Generic platform) and mostly work without a standard library. For a single compiler there could be a couple of toolchain files depending e.g. on specific CPU core settings and SoC type.

This means that a couple of toolchain files share some common setting.

In this situation we are thinking on using own custom platform files injected by CMAKE_MODULE_PATH like in CMakes own module folder (Module/Platform), i.e. Platform/Generic-<CMAKE_C_COMPILER_ID>-<LANG>-<CMAKE_SYSTEM_PROCESSOR>. Local tests showed that this basically works.

But is this interface stable and save to use?

I did not find a good reference on best practices regarding toolchain files besides the simple examples in mastering CMake and cmake-toolchains. cmake-toolchains does not mention platform files, mastering CMake does, but does not explicitely state the exact file naming convention.

Regards
Georg