cmake: Improve automatic versioning

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2018-04-23 17:52:40 +02:00
parent 118cd2c6d8
commit 0b5a848c32

View file

@ -18,8 +18,18 @@
*/
#pragma once
#include <inttypes.h>
const uint16_t PLUGIN_VERSION_MAJOR = @VERSION_MAJOR@;
const uint16_t PLUGIN_VERSION_MINOR = @VERSION_MINOR@;
const uint32_t PLUGIN_VERSION_PATCH = @VERSION_PATCH@;
#define MAKE_VERSION(major,minor,patch,tweak) ((uint64_t(major) & 0xFFFFull) << 48ull) | ((uint64_t(minor) & 0xFFFFull) << 32ull) | ((uint64_t(patch) & 0xFFFFull) << 16ull) | ((uint64_t(patch) & 0xFFFFull))
const uint16_t PROJECT_VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
const uint16_t PROJECT_VERSION_MINOR = @PROJECT_VERSION_MINOR@;
const uint16_t PROJECT_VERSION_PATCH = @PROJECT_VERSION_PATCH@;
const uint16_t PROJECT_VERSION_TWEAK = @PROJECT_VERSION_TWEAK@;
const uint64_t PROJECT_VERSION = MAKE_VERSION(PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH, PROJECT_VERSION_TWEAK);
const uint16_t PLUGIN_VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
const uint16_t PLUGIN_VERSION_MINOR = @PROJECT_VERSION_MINOR@;
const uint16_t PLUGIN_VERSION_PATCH = @PROJECT_VERSION_PATCH@;
const uint16_t PLUGIN_VERSION_TWEAK = @PROJECT_VERSION_TWEAK@;
const uint64_t PLUGIN_VERSION_FULL = (((uint64_t)(PLUGIN_VERSION_MAJOR & 0xFFFF) << 48ull) | ((uint64_t)(PLUGIN_VERSION_MINOR & 0xFFFF) << 32ull) | ((uint64_t)(PLUGIN_VERSION_PATCH) & 0xFFFFFFFF));