Should CMake automatically determine CMAKE_SYSROOT when using a (cross-)compiler that can provide this information?
A gcc cross-compiler can be asked for its sysroot via --print-sysroot
. I found myself needing to create a toolchain file just to set this value but it seems like something that CMake could/should do automatically.
If a merge-request for this was acceptable then I'll be happy to have a go. Any pointers so I do not start off on the wrong path would be appreciated too as I am definitely not clear on a few of the technical aspects, for example, should such a sysroot be excluded from CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES
and/or CMAKE_EXTRA_GENERATOR_<LANG>_SYSTEM_INCLUDE_DIRS
?