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

Method WriteProjectStart

Source/cmLocalVisualStudio7Generator.cxx:2038–2088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2036}
2037
2038void cmLocalVisualStudio7Generator::WriteProjectStart(
2039 std::ostream& fout, std::string const& libName, cmGeneratorTarget* target)
2040{
2041 if (this->FortranProject) {
2042 this->WriteProjectStartFortran(fout, libName, target);
2043 return;
2044 }
2045
2046 cmGlobalVisualStudio7Generator* gg =
2047 static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
2048
2049 fout << R"(<?xml version="1.0" encoding = ")" << gg->Encoding()
2050 << "\"?>\n"
2051 "<VisualStudioProject\n"
2052 "\tProjectType=\"Visual C++\"\n"
2053 "\tVersion=\""
2054 << (static_cast<uint16_t>(gg->GetVersion()) / 10) << ".00\"\n";
2055 cmValue p = target->GetProperty("PROJECT_LABEL");
2056 std::string const projLabel = p ? *p : libName;
2057 p = target->GetProperty("VS_KEYWORD");
2058 std::string const keyword = p ? *p : "Win32Proj";
2059 fout << "\tName=\"" << projLabel
2060 << "\"\n"
2061 "\tProjectGUID=\"{"
2062 << gg->GetGUID(libName) << "}\"\n";
2063 this->WriteProjectSCC(fout, target);
2064 if (cmValue targetFrameworkVersion =
2065 target->GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) {
2066 fout << "\tTargetFrameworkVersion=\"" << *targetFrameworkVersion << "\"\n";
2067 }
2068 /* clang-format off */
2069 fout << "\tKeyword=\"" << keyword << "\">\n"
2070 "\t<Platforms>\n"
2071 "\t\t<Platform\n\t\t\tName=\"" << gg->GetPlatformName() << "\"/>\n"
2072 "\t</Platforms>\n";
2073 /* clang-format on */
2074 if (gg->IsMarmasmEnabled()) {
2075 fout << "\t<ToolFiles>\n"
2076 "\t\t<DefaultToolFile\n"
2077 "\t\t\tFileName=\"marmasm.rules\"\n"
2078 "\t\t/>\n"
2079 "\t</ToolFiles>\n";
2080 }
2081 if (gg->IsMasmEnabled()) {
2082 fout << "\t<ToolFiles>\n"
2083 "\t\t<DefaultToolFile\n"
2084 "\t\t\tFileName=\"masm.rules\"\n"
2085 "\t\t/>\n"
2086 "\t</ToolFiles>\n";
2087 }
2088}
2089
2090void cmLocalVisualStudio7Generator::WriteVCProjFooter(
2091 std::ostream& fout, cmGeneratorTarget* target)

Callers 1

WriteVCProjFileMethod · 0.95

Calls 8

WriteProjectSCCMethod · 0.95
IsMarmasmEnabledMethod · 0.80
IsMasmEnabledMethod · 0.80
EncodingMethod · 0.45
GetVersionMethod · 0.45
GetPropertyMethod · 0.45
GetGUIDMethod · 0.45

Tested by

no test coverage detected