From 512842bfa5eca7b7678ff5fcc93d0fcefff477e7 Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Thu, 30 Jul 2026 13:16:37 +0200 Subject: [PATCH] Set Steam DLL version from EnderalVersion.ini --- source/Steam DLL/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/Steam DLL/CMakeLists.txt b/source/Steam DLL/CMakeLists.txt index a67cca9a8..2170045c3 100644 --- a/source/Steam DLL/CMakeLists.txt +++ b/source/Steam DLL/CMakeLists.txt @@ -4,9 +4,19 @@ cmake_minimum_required(VERSION 3.21) ## Define project ######################################################################################################################## +# Get current version +set(ENDERAL_VERSION_INI "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/EnderalVersion.ini") +file(READ "${ENDERAL_VERSION_INI}" CONFIG_CONTENT) +string(REGEX MATCH "version[ \t]*=[ \t]*([0-9.]+)" _ ${CONFIG_CONTENT}) +set(VERSION_NUMBER "${CMAKE_MATCH_1}") + +# file(READ) does not register a dependency: without this, bumping the version in +# the INI would not re-run CMake and the DLL would keep the previous version. +set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${ENDERAL_VERSION_INI}") + project( EnderalSteam - VERSION 2.1.4 + VERSION ${VERSION_NUMBER} DESCRIPTION "Enderal SE Steam Support" LANGUAGES CXX ) @@ -15,7 +25,7 @@ project( set(PROJECT_FRIENDLY_NAME "Enderal SE") # The binary FILEVERSION/PRODUCTVERSION fields need all four components; -# PROJECT_VERSION_TWEAK is empty when the version above carries only three. +# PROJECT_VERSION_TWEAK is empty when the INI carries only three. if(NOT PROJECT_VERSION_TWEAK) set(PROJECT_VERSION_TWEAK 0) endif()