File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed
Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,6 @@ call :is_file_installed cmake || set abort=1
2020call :is_file_installed make || set abort = 1
2121if %abort% == 1 exit /b
2222
23- echo Running CMake version check...
24- call ../check_cmake_version.bat
25- if errorlevel 1 (
26- echo Exiting due to CMake version error.
27- exit /b 1
28- )
29- echo Proceeding with build...
30-
3123set CURDIR = %CD%
3224
3325:: *** define root directory where fds repo and libs directories are located
@@ -84,6 +76,15 @@ echo ----------------------------------------------------------
8476echo ----------------------------------------------------------
8577echo .
8678
79+ echo Running CMake version check...
80+ call %CURDIR% /../check_cmake_version.bat
81+ if errorlevel 1 (
82+ echo Exiting due to CMake version error.
83+ pause
84+ exit /b 1
85+ )
86+ echo Proceeding with build...
87+
8788echo .
8889echo ----------------------------------------------------------
8990echo ----------------------------------------------------------
Original file line number Diff line number Diff line change @@ -3,35 +3,36 @@ setlocal enabledelayedexpansion
33
44set REQUIRED_MAJOR = 3
55set REQUIRED_MINOR = 21
6+ set VERSION_STRING = %REQUIRED_MAJOR% .%REQUIRED_MINOR% .0
67
78:: Check if cmake is installed
89where cmake > nul 2 > nul
910if errorlevel 1 (
10- echo Error: CMake is not installed. Please install CMake version 3.21.0 or newer.
11+ echo Error: CMake is not installed. Please install CMake version %VERSION_STRING% or newer.
1112 exit /b 1
1213)
1314
14- :: Get installed cmake version
15- for /f " tokens=3" %%v in ('cmake --version') do (
15+ :: Extract the version number
16+ for /f " tokens=3" %%v in ('cmake --version ^ | findstr /i " version " ') do (
1617 set VERSION = %%v
17- goto :parse_version
1818)
1919
20- :parse_version
20+ :: Parse version into major, minor, patch
2121for /f " tokens=1,2,3 delims=." %%a in (" !VERSION! " ) do (
2222 set MAJOR = %%a
2323 set MINOR = %%b
2424 set PATCH = %%c
2525)
2626
27- :: Compare version
27+ :: Compare major version
2828if !MAJOR! LSS %REQUIRED_MAJOR% (
29- echo Error: Installed CMake version is !VERSION! . Version 3.21.0 or newer is required.
29+ echo Error: Installed CMake version is !VERSION! . Version %VERSION_STRING% or newer is required.
3030 exit /b 1
3131)
3232
33+ :: Compare minor version if major matches
3334if !MAJOR! EQU %REQUIRED_MAJOR% if !MINOR! LSS %REQUIRED_MINOR% (
34- echo Error: Installed CMake version is !VERSION! . Version 3.21.0 or newer is required.
35+ echo Error: Installed CMake version is !VERSION! . Version %VERSION_STRING% or newer is required.
3536 exit /b 1
3637)
3738
You can’t perform that action at this time.
0 commit comments