My project definition expect different set of languages according to architecture (macOS or Windows).
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
project(myProj CXX OBJC OBJCXX)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
project(myProj CXX)
endif()
However, it looks like the CMAKE_SYSTEM_NAME is only defined after the project command. like in this sample code, only the second message will show valid arch.
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
project(myProj)
message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
Any idea how to fetch the running arch before the project is defined ?