summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-11-03 14:34:58 -0400
committerBrad King <brad.king@kitware.com>2021-11-06 06:08:55 -0400
commitd51246c6621aa5025e06fcea720930ae00e6f448 (patch)
tree458ea119891eb6bfd12afdb1741b2493819e2096
parentf97f8537f371daa073edce34f54743d1f261c022 (diff)
downloadcmake-d51246c6621aa5025e06fcea720930ae00e6f448.tar.gz
VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
MSBuild defaults to v4.0 but VS 2022 does not install it anymore. Explicitly specify a newer framework version by default. Use a version that VS 2022 installs without selecting a separate component. Fixes: #22835
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index f27b2c47d3..b5a6b9fdc6 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -401,6 +401,12 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
this->DefaultPlatformName = VSHostPlatformName();
this->DefaultPlatformToolsetHostArchitecture = VSHostArchitecture();
}
+ if (this->Version >= cmGlobalVisualStudioGenerator::VS17) {
+ // FIXME: Search for an existing framework? Under '%ProgramFiles(x86)%',
+ // see 'Reference Assemblies\Microsoft\Framework\.NETFramework'.
+ // Use a version installed by VS 2022 without a separate component.
+ this->DefaultTargetFrameworkVersion = "v4.7.2";
+ }
}
bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName(