# Set up architecture to host if OCKAM_TARGET_PLATFORM was not defined
if(NOT DEFINED OCKAM_TARGET_PLATFORM)
  if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
    if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
      include(${CMAKE_MODULE_PATH}/platform/linux.cmake)
    elseif("${CMAKE_SYSTEM_NAME}" MATCHES "([dD]arwin|Mac OS X)")
      include(${CMAKE_MODULE_PATH}/platform/mac.cmake)
    else()
      message(FATAL_ERROR "Unable to determine host system name!")
    endif()
  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv8")
    if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
      message(WARNING "Falling back to detecting target platform. It is recommended to specify OCKAM_TARGET_PLATFORM or OCKAM_TARGET_TRIPLE")
      message(WARNING "Detected target arch/os is armv8/linux, assuming target triple of armv8-rpi3-linux-gnueabihf")
      if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin")
        include(${CMAKE_MODULE_PATH}/platform/raspberry-pi-mac.cmake)
      else()
        include(${CMAKE_MODULE_PATH}/platform/raspberry-pi.cmake)
      endif()
    else()
      message(FATAL_ERROR "Unable to determine host system name!")
    endif()
  else()
    message(FATAL_ERROR "Unable to determine host processor!")
  endif()
endif()
