From 7f4918f1f17b0ddde6d1a8435e63f5f94c6dd065 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 20 Apr 2026 12:50:39 -0400 Subject: Generate version string based on repository information --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fc403ca..73f5555 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,14 @@ cmake_minimum_required(VERSION 3.15) project(STASIS C) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") + include(GNUInstallDirs) +include(GitVersion) +get_version_from_git() +configure_file( + ${CMAKE_SOURCE_DIR}/include/version.h.in + ${CMAKE_BINARY_DIR}/include/version.h +) set(nix_cflags -Wall -Wextra -fPIC -D_GNU_SOURCE) set(win_cflags /Wall) -- cgit From 059f3539bf3f840f8ea76b19db3713dd6696e4c1 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 21 Apr 2026 12:02:43 -0400 Subject: Show STASIS version during cmake config --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 73f5555..817f88d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ configure_file( ${CMAKE_SOURCE_DIR}/include/version.h.in ${CMAKE_BINARY_DIR}/include/version.h ) +message("-- STASIS version: ${PROJECT_VERSION} (${PROJECT_VERSION_BRANCH})") set(nix_cflags -Wall -Wextra -fPIC -D_GNU_SOURCE) set(win_cflags /Wall) -- cgit