Skip to content

Commit 6ac262f

Browse files
committed
configonly.bat: retrieve version from CMakeLists.txt
1 parent 711ec1d commit 6ac262f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

ms-windows/osgeo4w/configonly.bat

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,23 @@ if "%ARCH%"=="x86" (
2424

2525
set CONFIGONLY=1
2626

27-
package-nightly.cmd 3.1.0 99 qgis-test %ARCH%
27+
setlocal enabledelayedexpansion
28+
29+
for /f "tokens=*" %%L in (..\..\CMakeLists.txt) do (
30+
set L=%%L
31+
set V=!L:SET(CPACK_PACKAGE_VERSION_=!
32+
if not !V!==!L! (
33+
set V=!V:"=!
34+
set V=!V:^)=!
35+
set _major=!V:MAJOR =!
36+
set _minor=!V:MINOR =!
37+
set _patch=!V:PATCH =!
38+
if not !_major!==!V! set MAJOR=!_major!
39+
if not !_minor!==!V! set MINOR=!_minor!
40+
if not !_patch!==!V! set PATCH=!_patch!
41+
)
42+
)
43+
44+
package-nightly.cmd %MAJOR%.%MINOR%.%PATCH% 99 qgis-test %ARCH%
45+
46+
endlocal

0 commit comments

Comments
 (0)