From 6ac262f432d80a62c930598c124f1f9f01a38349 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Tue, 9 Oct 2018 02:29:17 +0200 Subject: [PATCH] configonly.bat: retrieve version from CMakeLists.txt --- ms-windows/osgeo4w/configonly.bat | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ms-windows/osgeo4w/configonly.bat b/ms-windows/osgeo4w/configonly.bat index e78ba618d23..ee2aa625418 100644 --- a/ms-windows/osgeo4w/configonly.bat +++ b/ms-windows/osgeo4w/configonly.bat @@ -24,4 +24,23 @@ if "%ARCH%"=="x86" ( set CONFIGONLY=1 -package-nightly.cmd 3.1.0 99 qgis-test %ARCH% +setlocal enabledelayedexpansion + +for /f "tokens=*" %%L in (..\..\CMakeLists.txt) do ( + set L=%%L + set V=!L:SET(CPACK_PACKAGE_VERSION_=! + if not !V!==!L! ( + set V=!V:"=! + set V=!V:^)=! + set _major=!V:MAJOR =! + set _minor=!V:MINOR =! + set _patch=!V:PATCH =! + if not !_major!==!V! set MAJOR=!_major! + if not !_minor!==!V! set MINOR=!_minor! + if not !_patch!==!V! set PATCH=!_patch! + ) +) + +package-nightly.cmd %MAJOR%.%MINOR%.%PATCH% 99 qgis-test %ARCH% + +endlocal