build: Improve cryptopp version detection
Change-Id: Ice7f69d0668e1943d2f27b5f15c0384854456d1a
diff --git a/.waf-tools/cryptopp.py b/.waf-tools/cryptopp.py
index a005123..8244d53 100644
--- a/.waf-tools/cryptopp.py
+++ b/.waf-tools/cryptopp.py
@@ -87,12 +87,14 @@
try:
txt = file.read()
- re_version = re.compile('^#define\\s+CRYPTOPP_VERSION\\s+(.*)', re.M)
+ re_version = re.compile('^#define\\s+CRYPTOPP_VERSION\\s+([0-9]+)', re.M)
match = re_version.search(txt)
if match:
self.env.CRYPTOPP_VERSION = match.group(1)
- self.end_msg(self.env.CRYPTOPP_VERSION)
+ v = int(self.env.CRYPTOPP_VERSION)
+ (major, minor, patch) = (int(v / 100), int(v % 100 / 10), int(v % 10))
+ self.end_msg("%d.%d.%d" % (major, minor, patch))
else:
self.fatal('CryptoPP files are present, but are not recognizable')
except: