#
# Copyright (c) 2020 Microsoft. All rights reserved.
#

if(CMAKE_BUILD_TYPE MATCHES "Debug")
    set(DEBUG_BUILD 1)
else()
    set(DEBUG_BUILD 0)
endif()

# DICE Image

set(VERSION_DICE_MAJOR 0)
set(VERSION_DICE_MINOR 3)
set(VERSION_DICE_PATCH 0)

set(VERSION_DICE_FLAG_IS_DEBUG ${DEBUG_BUILD})
math(EXPR VERSION_DICE_FLAGS
    "${VERSION_DICE_FLAG_IS_DEBUG} << 7"
    OUTPUT_FORMAT HEXADECIMAL)

math(EXPR VERSION_DICE_FULL
    "(${VERSION_DICE_FLAGS} << 24) |
     (${VERSION_DICE_MAJOR} << 16) | (${VERSION_DICE_MINOR} << 8) | ${VERSION_DICE_PATCH}"
    OUTPUT_FORMAT HEXADECIMAL)

# L0 Image
set(L0_VERSION 0)

set(VERSION_L0_MAJOR 0)
set(VERSION_L0_MINOR 3)
set(VERSION_L0_PATCH 0)

set(VERSION_L0_FLAG_IS_DEBUG ${DEBUG_BUILD})
math(EXPR VERSION_L0_FLAGS
    "${VERSION_L0_FLAG_IS_DEBUG} << 7"
    OUTPUT_FORMAT HEXADECIMAL)

math(EXPR VERSION_L0_FULL
    "(${VERSION_L0_FLAGS} << 24) |
     (${VERSION_L0_MAJOR} << 16) | (${VERSION_L0_MINOR} << 8) | ${VERSION_L0_PATCH}"
    OUTPUT_FORMAT HEXADECIMAL)

# L1 Image

set(VERSION_L1_MAJOR 0)
set(VERSION_L1_MINOR 3)
set(VERSION_L1_PATCH 0)

set(VERSION_L1_FLAG_IS_DEBUG ${DEBUG_BUILD})
math(EXPR VERSION_L1_FLAGS
    "${VERSION_L1_FLAG_IS_DEBUG} << 7"
    OUTPUT_FORMAT HEXADECIMAL)

math(EXPR VERSION_L1_FULL
    "(${VERSION_L1_FLAGS} << 24) |
     (${VERSION_L1_MAJOR} << 16) | (${VERSION_L1_MINOR} << 8) | ${VERSION_L1_PATCH}"
    OUTPUT_FORMAT HEXADECIMAL)
