Misleading property and variable names and docs for Windows SDK version
I've been reviewing the documentation and behavior of the following to get a deeper understanding of how they affect Windows builds:
- Policy CMP0149.
- The VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION target property and its associated CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION variable.
- The CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM variable.
- The CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable (this one should be considered read-only, but the docs don't explicitly state that).
All of these actually relate to the selection of the Windows SDK version, but that is not the same as the minimum Windows version required at run time. The minimum Windows version at run time is actually controlled by the _WIN32_WINNT
compiler definition (and WINVER
for much older SDKs). You can build with a very recent SDK, but have the minimum deployment version set to something quite old. The only way that the SDK version relates to the minimum deployment version is that if you require a fairly recent deployment version, then the SDK you use has to know about it.
Unfortunately, apart from the inconsistencies in the naming between the above variables and properties (..._MIN_VERSION
and ..._VERSION_MAXIMUM
), those names incorrectly imply that they control or relate to the target platform version, not the SDK version. The description of each one contains at least some degree of misleading comments, except for the CMP0149
policy docs. This would be somewhat disruptive to fix. It would require new names that more accurately reflect what the properties and variables do, the new properties would need to take precedence over the old ones, and the old ones should be deprecated but still kept around for a long time. I don't know if a policy would be needed, or could even be used for this.