File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ 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+
2331set CURDIR = %CD%
2432
2533:: *** define root directory where fds repo and libs directories are located
Original file line number Diff line number Diff line change 1+ @ echo off
2+ setlocal enabledelayedexpansion
3+
4+ set REQUIRED_MAJOR = 3
5+ set REQUIRED_MINOR = 21
6+
7+ :: Check if cmake is installed
8+ where cmake > nul 2 > nul
9+ if errorlevel 1 (
10+ echo Error: CMake is not installed. Please install CMake version 3.21.0 or newer.
11+ exit /b 1
12+ )
13+
14+ :: Get installed cmake version
15+ for /f " tokens=3" %%v in ('cmake --version') do (
16+ set VERSION = %%v
17+ goto :parse_version
18+ )
19+
20+ :parse_version
21+ for /f " tokens=1,2,3 delims=." %%a in (" !VERSION! " ) do (
22+ set MAJOR = %%a
23+ set MINOR = %%b
24+ set PATCH = %%c
25+ )
26+
27+ :: Compare version
28+ if !MAJOR! LSS %REQUIRED_MAJOR% (
29+ echo Error: Installed CMake version is !VERSION! . Version 3.21.0 or newer is required.
30+ exit /b 1
31+ )
32+
33+ if !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+ exit /b 1
36+ )
37+
38+ echo CMake version !VERSION! is sufficient.
39+ exit /b 0
You can’t perform that action at this time.
0 commit comments