macro (canonical_host) if (NOT __test_canonical_host) message (STATUS "checking the host CPU") execute_process ( COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine RESULT_VARIABLE __canonical_host_result OUTPUT_VARIABLE __canonical_host_output ) if (${__canonical_host_result}) message (FATAL_ERROR "unable to query for canonical host") endif (${__canonical_host_result}) string(REGEX MATCH "^([^-\]+)" HOST_CPU ${__canonical_host_output}) message (STATUS "checking the host CPU - found '${HOST_CPU}'") endif (NOT __test_canonical_host) set (__test_canonical_host 1 INTERNAL) endmacro (canonical_host)