if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    set(DETECTED_OS_WIN 1)
    message("DETECTED_OS_WIN")
elseif(CMAKE_SYSTEM_NAME MATCHES "Android" OR ANDROID)
    set(DETECTED_OS_ANDROID 1)
    message("DETECTED_OS_ANDROID")
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
    set(DETECTED_OS_LINUX 1)
    message("DETECTED_OS_LINUX")
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "DragonFly")
    set(DETECTED_OS_FREEBSD 1)
    message("DETECTED_OS_FREEBSD")
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
    set(DETECTED_OS_OPENBSD 1)
    message("DETECTED_OS_OPENBSD")
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
    set(DETECTED_OS_NETBSD 1)
    message("DETECTED_OS_NETBSD")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
    set(DETECTED_OS_MAC 1)
    message("DETECTED_OS_MAC")
elseif(CMAKE_SYSTEM_NAME MATCHES "AIX")
    set(DETECTED_OS_AIX 1)
    message("DETECTED_OS_AIX")
elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
    set(DETECTED_OS_SOLARIS 1)
    message("DETECTED_OS_SOLARIS")
elseif(CMAKE_SYSTEM_NAME MATCHES "zOS")
    set(DETECTED_OS_ZOS 1)
    message("DETECTED_OS_ZOS")
else()
    message(FATAL_ERROR "Unsupported operating system")
    return()
endif()
