if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  set(LMAGI_CLANG 0)
  set(LMAGI_GCC   1)
  set(LMAGI_MSVC  0)
  message(STATUS "Compiler: GNU")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
  set(LMAGI_CLANG 1)
  set(LMAGI_GCC   0)
  set(LMAGI_MSVC  0)
  message(STATUS "Compiler: Clang")
elseif (MSVC)
  set(LMAGI_CLANG 0)
  set(LMAGI_GCC   0)
  set(LMAGI_MSVC  1)
  message(STATUS "Compiler: MSVC")
else()
  message(FATAL_ERROR "Compiler: UNKNOWN")
endif()

message(STATUS "Compiler detected: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_SIMULATE_ID}")
