cmake/canonical_host.cmake

21 lines
717 B
CMake
Raw Normal View History

2017-01-17 19:20:12 +11:00
macro (canonical_host)
if (NOT DEFINED host_cpu)
2017-01-17 19:20:12 +11:00
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})
set (host_cpu "${host_cpu}" CACHE INTERNAL "host cpu type")
2017-01-17 19:20:12 +11:00
message (STATUS "checking the host CPU - found '${host_cpu}'")
endif ()
2017-01-17 19:20:12 +11:00
endmacro (canonical_host)