From 03b3f0c5345e4ddc4cdfad050e9b28e79ffa6721 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 15 Feb 2026 18:29:10 +0100 Subject: build: Add a version target This adds a make version target, that will print the version from the build directory without having to compile and run irmd --version. [100%] Updating git hash in version.h [100%] Built target version_header Ouroboros 0.22.0-37-ga3a5da14-dirty [100%] Built target version Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- cmake/utils/PrintVersion.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cmake/utils/PrintVersion.cmake (limited to 'cmake/utils/PrintVersion.cmake') diff --git a/cmake/utils/PrintVersion.cmake b/cmake/utils/PrintVersion.cmake new file mode 100644 index 00000000..34148eb7 --- /dev/null +++ b/cmake/utils/PrintVersion.cmake @@ -0,0 +1,8 @@ +file(STRINGS "${VERSION_HEADER}" lines REGEX "OUROBOROS_VERSION_STRING") +foreach(line ${lines}) + if(line MATCHES "define OUROBOROS_VERSION_STRING \"(.*)\"") + set(version "${CMAKE_MATCH_1}") + message("Ouroboros ${version}") + break() + endif() +endforeach() -- cgit v1.2.3