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