From ab2876053a6063de237c836ac0226f01e74f1023 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sun, 5 Jan 2020 11:42:15 +0100 Subject: newtype: bump version to 1.0.0 --- CMakeLists.txt | 2 +- conanfile.py | 15 ++++++++++++++- include/newtype/version.hpp | 23 +++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 include/newtype/version.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1624dce..275877a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION "3.9.0") project("newtype" - VERSION "0.0.1" + VERSION "1.0.0" LANGUAGES CXX DESCRIPTION "A library of types and functions to create strong type aliases" ) diff --git a/conanfile.py b/conanfile.py index bebb254..6fcbf48 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,4 +1,17 @@ +import re + from conans import ConanFile, CMake +from conans.tools import load + + +def get_version(): + try: + content = load("CMakeLists.txt") + version = re.search("project\(\"newtype\"\s*VERSION \"(.*)\"", content).group(1) + return version.strip() + except: + return None + class NewtypeConan(ConanFile): name = "newtype" @@ -7,7 +20,7 @@ class NewtypeConan(ConanFile): "url": "https://github.com/fmorgner/newtype.git", "revision": "auto", } - version = "0.0.1" + version = get_version() license = "BSD-3-Clause" url = "https://github.com/fmorgner/newtype" description = "A library of types and functions to create strong type aliases" diff --git a/include/newtype/version.hpp b/include/newtype/version.hpp new file mode 100644 index 0000000..c7c3314 --- /dev/null +++ b/include/newtype/version.hpp @@ -0,0 +1,23 @@ +#ifndef NEWTYPE_VERSION_HPP +#define NEWTYPE_VERSION_HPP + +namespace nt +{ + + constexpr struct + { + int const major; + int const minor; + int const patch; + + char const * const name; + } version{ + .major = 1, + .minor = 0, + .patch = 0, + .name = "Francesca", + }; + +} // namespace nt + +#endif \ No newline at end of file -- cgit v1.2.3