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

Method GenerateImportFileConfig

Source/cmExportInstallFileGenerator.cxx:103–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103bool cmExportInstallFileGenerator::GenerateImportFileConfig(
104 std::string const& config)
105{
106 // Skip configurations not enabled for this export.
107 if (!this->IEGen->InstallsForConfig(config)) {
108 return true;
109 }
110
111 // Construct the name of the file to generate.
112 std::string fileName = cmStrCat(this->FileDir, '/', this->FileBase,
113 this->GetConfigFileNameSeparator());
114 if (!config.empty()) {
115 fileName += cmSystemTools::LowerCase(config);
116 } else {
117 fileName += "noconfig";
118 }
119 fileName += this->FileExt;
120
121 // Open the output file to generate it.
122 cmGeneratedFileStream exportFileStream(fileName, true);
123 if (!exportFileStream) {
124 std::string se = cmSystemTools::GetLastSystemError();
125 std::ostringstream e;
126 e << "cannot write to file \"" << fileName << "\": " << se;
127 cmSystemTools::Error(e.str());
128 return false;
129 }
130 exportFileStream.SetCopyIfDifferent(true);
131 std::ostream& os = exportFileStream;
132
133 // Generate the per-config target information.
134 this->GenerateImportConfig(os, config);
135
136 // Record this per-config import file.
137 this->ConfigImportFiles[config] = fileName;
138
139 return true;
140}
141
142void cmExportInstallFileGenerator::SetImportLocationProperty(
143 std::string const& config, std::string const& suffix,

Callers 2

GenerateMainFileMethod · 0.80
GenerateMainFileMethod · 0.80

Calls 8

InstallsForConfigMethod · 0.80
strMethod · 0.80
SetCopyIfDifferentMethod · 0.80
cmStrCatFunction · 0.70
ErrorClass · 0.70
emptyMethod · 0.45
GenerateImportConfigMethod · 0.45

Tested by

no test coverage detected