MCPcopy Create free account
hub / github.com/Kitware/CMake / FindMSBuildCommand

Method FindMSBuildCommand

Source/cmGlobalVisualStudioVersionedGenerator.cxx:1004–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002}
1003
1004std::string cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommand()
1005{
1006 std::string msbuild;
1007
1008 // Ask Visual Studio Installer tool.
1009 std::string vs;
1010 if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
1011 if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS17) {
1012 if (VSIsArm64Host()) {
1013 if (VSHasDotNETFrameworkArm64()) {
1014 msbuild = cmStrCat(vs, "/MSBuild/Current/Bin/arm64/MSBuild.exe");
1015 if (cmSystemTools::FileExists(msbuild)) {
1016 return msbuild;
1017 }
1018 }
1019 if (VSIsWindows11OrGreater()) {
1020 msbuild = cmStrCat(vs, "/MSBuild/Current/Bin/amd64/MSBuild.exe");
1021 if (cmSystemTools::FileExists(msbuild)) {
1022 return msbuild;
1023 }
1024 }
1025 } else {
1026 msbuild = cmStrCat(vs, "/MSBuild/Current/Bin/amd64/MSBuild.exe");
1027 if (cmSystemTools::FileExists(msbuild)) {
1028 return msbuild;
1029 }
1030 }
1031 }
1032 msbuild = cmStrCat(vs, "/MSBuild/Current/Bin/MSBuild.exe");
1033 if (cmSystemTools::FileExists(msbuild)) {
1034 return msbuild;
1035 }
1036 msbuild = cmStrCat(vs, "/MSBuild/15.0/Bin/MSBuild.exe");
1037 if (cmSystemTools::FileExists(msbuild)) {
1038 return msbuild;
1039 }
1040 }
1041
1042 msbuild = "MSBuild.exe";
1043 return msbuild;
1044}
1045
1046std::string cmGlobalVisualStudioVersionedGenerator::FindDevEnvCommand()
1047{

Callers

nothing calls this directly

Calls 6

VSIsArm64HostFunction · 0.85
VSIsWindows11OrGreaterFunction · 0.85
GetVSInstanceInfoMethod · 0.80
cmStrCatFunction · 0.70
FileExistsFunction · 0.50

Tested by

no test coverage detected