From 61bc6193abf415a78f92e7adfab9ab5e48414ee6 Mon Sep 17 00:00:00 2001 From: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> Date: Tue, 11 Nov 2025 23:40:49 -0300 Subject: [PATCH] CMake 4.x. windows (#10820) * cmake 4 windows Update CMakeLists.txt cmake 4 windows Update build_release_vs2022.bat minimum version 3.5 * Update CMakeLists.txt --- CMakeLists.txt | 6 +++--- build_release_vs2022.bat | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e11ab904a..247c295899 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.13) -# Verify that your CMake version is exactly 3.31.x series or lower on windows -if ( ((MSVC) OR (WIN32)) AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") ) - message(FATAL_ERROR "Only cmake versions between 3.13.x and 3.31.x is supported on windows. Detected version: ${CMAKE_VERSION}") +# Verify that your CMake version is exactly 3.5 series or higher on windows +if ( (MSVC OR WIN32) AND (${CMAKE_VERSION} VERSION_LESS "3.5") ) + message(FATAL_ERROR "CMake current version ${CMAKE_VERSION} is too old. Minimum required is 3.5.") endif() if (WIN32) diff --git a/build_release_vs2022.bat b/build_release_vs2022.bat index ce4390f621..cde00008ff 100644 --- a/build_release_vs2022.bat +++ b/build_release_vs2022.bat @@ -46,6 +46,8 @@ if "%1"=="slicer" ( echo "building deps.." echo on +REM Set minimum CMake policy to avoid <3.5 errors +set CMAKE_POLICY_VERSION_MINIMUM=3.5 cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%build_type% cmake --build . --config %build_type% --target deps -- -m @echo off