[cmake] always target Windows SDK v10.x when using Visual Studio generators (fixes #6448) #6451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6448
Related to #5884.
Helps with #6213.
Proposes always targeting v10.x of the Windows SDK in CMake builds using the Visual Studio generators.
Notes for Reviewers
How I tested this
Building the R package, using Visual Studio 17 2022, on my Windows laptop running Windows 10 Home Edition.
With rtools44 (https://cran.r-project.org/bin/windows/Rtools/rtools44/rtools.html) on PATH.
Without this change,
CMake
targets via 8.1 of the Windows SDK and detects the wrong Windows version.That causes all of the Visual Studio and then the MSBuild solutions to fail, and therefore installation of the R package to fail.
With this change, it correctly targets v10 of the Windows SDK.
References