summaryrefslogtreecommitdiff
path: root/cmake/utils/PrintVersion.cmake
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-02-15 18:29:10 +0100
committerSander Vrijders <sander@ouroboros.rocks>2026-02-18 08:02:21 +0100
commit03b3f0c5345e4ddc4cdfad050e9b28e79ffa6721 (patch)
treef3aff1cca2f3e67a220f85cdfef5693eb9ecdfdb /cmake/utils/PrintVersion.cmake
parent079035dbf4890e667c5e931295a1c24f28d9c0df (diff)
downloadouroboros-03b3f0c5345e4ddc4cdfad050e9b28e79ffa6721.tar.gz
ouroboros-03b3f0c5345e4ddc4cdfad050e9b28e79ffa6721.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'cmake/utils/PrintVersion.cmake')
-rw-r--r--cmake/utils/PrintVersion.cmake8
1 files changed, 8 insertions, 0 deletions
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()