aboutsummaryrefslogtreecommitdiff
path: root/conanfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py15
1 files changed, 14 insertions, 1 deletions
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"