
function(get_xcode_version_for_apple_clang output_variable)
    if(13.3.0 VERSION_LESS_EQUAL ${XCODE_VERSION})
        set(APPLE_CLANG_VERSION 13.1)
    elseif(13.0 VERSION_LESS_EQUAL ${XCODE_VERSION} AND ${XCODE_VERSION} VERSION_LESS 13.3.0)
        set(APPLE_CLANG_VERSION 13.0)
    elseif(12.0 VERSION_LESS_EQUAL ${XCODE_VERSION} AND ${XCODE_VERSION} VERSION_LESS 13.0)
        set(APPLE_CLANG_VERSION 12.0)
    elseif(11.0 VERSION_LESS_EQUAL ${XCODE_VERSION} AND ${XCODE_VERSION} VERSION_LESS 12.0)
        set(APPLE_CLANG_VERSION 11.0)
    elseif(${XCODE_VERSION} VERSION_LESS 11.0)
        set(APPLE_CLANG_VERSION 10.0)
    else()
        message(FATAL_ERROR "Error: Version of Xcode not supported! - XCODE_VERSION: ${XCODE_VERSION}")
    endif()
    set (${output_variable} ${APPLE_CLANG_VERSION} PARENT_SCOPE)
endfunction()

function(get_conan_architecture_for_osx_build_architecture output_variable)
    if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
        set(CONAN_ARCHITECTURE_NAME x86_64)
    elseif("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
        set(CONAN_ARCHITECTURE_NAME armv8)
    else()
        message(FATAL_ERROR "Error: Unknown architecture ! - CMAKE_OSX_ARCHITECTURES: ${CMAKE_OSX_ARCHITECTURES}")
    endif()
    set (${output_variable} ${CONAN_ARCHITECTURE_NAME} PARENT_SCOPE)
endfunction()
