Skip to content

Extend cmake_host_system_information() keywords

Florian Maushart requested to merge FloriansGit/cmake:master into master

Extended cmake_host_system_information() command by processor and OS identification query keywords. The KWSys library embedded in CMake does know the host systems processor and OS ids, but they were not accessible.

This change was inspired by a StackOverflow question asking how to identify the host systems processor:

https://stackoverflow.com/questions/43923444/how-to-determine-platforms-like-arm-mips-and-ia32

Even considering that a CMake project should check generator/compiler, platform or processor features (e.g. with try_compile() calls) or let the project's user decide the target platform (OS/processor), there are cases where this is relevant. So I wanted to give CMake a cross-platform way to e.g. check if the host processor IS_64BIT or HAS_IA64 instruction extensions.

And cmake_host_system_information() was already using information from KWSys, so it seems the obvious place for this extension (from functionality and context point of view).

Topic-rename: cmake_host_system_information-extend

Merge request reports