CMAKE: CMAKE_SYSTEM_PROCESSOR not set/empty although toolchain file is not used

242 Views Asked by At

We have a pretty large build environment with cmake, utilizing conan to install/download dependency files and then run our build. Within our build I need to identify the target system processor and therefore I am utilizing CMAKE_SYSTEM_PROCESSOR. However on M1 macbook this value seems to be empty and unset in our environment (does not occur on macbook with intel processor), such as I attempted to print the useful defines (after calling project(<NAME>)) and got;

=== CMAKE_SYSTEM_PROCESSOR:
=== CMAKE_HOST_SYSTEM_PROCESSOR: arm64
=== CMAKE_TOOLCHAIN_FILE:
=== CMAKE_APPLE_SILICON_PROCESSOR:

From my understanding if the CMAKE_TOOLCHAIN_FILE is unset then CMAKE_SYSTEM_PROCESSOR should equal the CMAKE_HOST_SYSTEM_PROCESSOR, which it does not occur in our use case. I attempted to make a more simply hello-world example on my system and it does indeed get set correctly, however I am unable to determine why this same does not occur in our environment.

0

There are 0 best solutions below