| 101 | } |
| 102 | |
| 103 | bool 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 | |
| 142 | void cmExportInstallFileGenerator::SetImportLocationProperty( |
| 143 | std::string const& config, std::string const& suffix, |
no test coverage detected