Skip to content

Avoid cmake_minimum_required(VERSION ...)- usage - #168

Merged
MarkSchofield merged 1 commit into
mainfrom
mschofie/cmake-version
Jul 8, 2026
Merged

Avoid cmake_minimum_required(VERSION ...)- usage#168
MarkSchofield merged 1 commit into
mainfrom
mschofie/cmake-version

Conversation

@MarkSchofield

@MarkSchofield MarkSchofield commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Fixes: #167

WindowsToolchain attempts to enforce a minimum version of CMake by writing:

cmake_minimum_required(VERSION 3.20)

But that both enforces the CMake version, and applies policies - which is inappropriate; only a consuming build should do that. This PR replaces cmake_minimum_required-calls with:

if(CMAKE_VERSION VERSION_LESS 3.20)
    message(FATAL_ERROR "WindowsToolchain requires at least CMake 3.20, but CMake ${CMAKE_VERSION} is in use.")
endif()

@MarkSchofield
MarkSchofield force-pushed the mschofie/cmake-version branch from c405119 to 6509f7a Compare July 8, 2026 17:29
@MarkSchofield
MarkSchofield merged commit c8fbde0 into main Jul 8, 2026
29 checks passed
@MarkSchofield
MarkSchofield deleted the mschofie/cmake-version branch July 8, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid cmake_minimum_required(VERSION ...)- usage

1 participant