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

Function LoadVSInstanceVCToolsetVersion

Source/cmVSSetupHelper.cxx:65–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63const WCHAR* ComponentType = L"Component";
64
65bool LoadVSInstanceVCToolsetVersion(VSInstanceInfo& vsInstanceInfo)
66{
67 std::string const vcRoot = vsInstanceInfo.GetInstallLocation();
68 std::string vcToolsVersionFile = cmStrCat(
69 vcRoot, "/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt");
70 std::string vcToolsVersion;
71 cmsys::ifstream fin(vcToolsVersionFile.c_str());
72 if (!fin || !cmSystemTools::GetLineFromStream(fin, vcToolsVersion)) {
73 return false;
74 }
75 vcToolsVersion = cmTrimWhitespace(vcToolsVersion);
76 std::string const vcToolsDir =
77 cmStrCat(vcRoot, "/VC/Tools/MSVC/", vcToolsVersion);
78 if (!cmSystemTools::FileIsDirectory(vcToolsDir)) {
79 return false;
80 }
81 vsInstanceInfo.VCToolsetVersion = vcToolsVersion;
82 return true;
83}
84}
85
86std::string VSInstanceInfo::GetInstallLocation() const

Calls 4

cmTrimWhitespaceFunction · 0.85
GetInstallLocationMethod · 0.80
c_strMethod · 0.80
cmStrCatFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…