I have a task that requires using the CMAKE_HOST_SYSTEM_PROCESSOR variable when executing the project() command. I want to specify a value for the CMAKE_OSX_ARCHITECTURES variable, which, according to the documentation (https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html#variable:CMAKE_OSX_ARCHITECTURES), must be filled before calling project(). This means I’m facing a chicken-and-egg problem. Considering that the value for the CMAKE_HOST_SYSTEM_PROCESSOR variable is assigned as a result of running external commands (https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html) and, in the case of macOS, for example, this is the result of running the uname -m command, there is no need to fill this value after calling the project() command, since the result will be the same. Therefore, a change might be made to ensure that the CMAKE_HOST_SYSTEM_PROCESSOR variable is populated before calling project() ?
Additional question: If CMAKE_OSX_ARCHITECTURES is not explicitly specified on macOS, is it correct to assume that the build will be performed for the current processor architecture?