#pragma once
// This file is generated by cmake. Changes will be overwritten.
// clang-format off

#include <string_view>

// Creates a version number for use in macro comparisons.
//
// Example:
//
// // Check if the version is less than 2.1.0
// #if ${UPPER_PROJECT_NAME}_VERSION < ${UPPER_PROJECT_NAME}_VERSION_CHECK(2, 1, 0)
//     // do stuff
// #endif
//
// Returns an integer which may be used in comparisons
#define ${UPPER_PROJECT_NAME}_VERSION_CHECK( major, minor, patch ) ( ((major)<<16) | ((minor)<<8) | (patch) )

#define ${UPPER_PROJECT_NAME}_VERSION_MAJOR  ${PROJECT_VERSION_MAJOR}
#define ${UPPER_PROJECT_NAME}_VERSION_MINOR  ${PROJECT_VERSION_MINOR}
#define ${UPPER_PROJECT_NAME}_VERSION_PATCH  ${PROJECT_VERSION_PATCH}

// The version number of this extension. Used for #if comparisons.
// This is generated using the version set in the CMake project macro.
#define ${UPPER_PROJECT_NAME}_VERSION  ${UPPER_PROJECT_NAME}_VERSION_CHECK( ${PROJECT_VERSION_MAJOR}, ${PROJECT_VERSION_MINOR}, ${PROJECT_VERSION_PATCH} )

namespace VersionInfo {
    // Project name and version as a string.
    // This is generated using the project name from the cmake project macro and the current git commit information.
    //
    // It uses the form "<project name> <last tag>-<# commits since last tag>-<short commit hash>".
    // If there are no commits since the last tag, only the tag is shown.
    constexpr std::string_view VERSION_STR = "${PROJECT_NAME} ${GIT_SHORT}";

    // The version information as a string.
    // This is generated using the current git commit information.
    //
    // It uses the form "<last tag>-<# commits since last tag>-<short commit hash>".
    // If there are no commits since the last tag, only the tag is shown.
    constexpr std::string_view VERSION_SHORT_STR = "${GIT_SHORT}";

    // The full git SHA1 hash as a string.
    // This is generated using the current git commit information.
    constexpr std::string_view GIT_SHA1_STR = "${GIT_SHA1}";
}
