| 219 | } |
| 220 | |
| 221 | cm::optional<std::string> |
| 222 | cmExportInstallPackageInfoGenerator::GetFileSetDirectory( |
| 223 | cmGeneratorTarget* gte, cmTargetExport const* te, cmFileSet* fileSet, |
| 224 | cm::optional<std::string> const& config) |
| 225 | { |
| 226 | cmGeneratorExpression ge(*gte->Makefile->GetCMakeInstance()); |
| 227 | auto cge = |
| 228 | ge.Parse(te->FileSetGenerators.at(fileSet->GetName())->GetDestination()); |
| 229 | |
| 230 | std::string const unescapedDest = |
| 231 | cge->Evaluate(gte->LocalGenerator, config.value_or(""), gte); |
| 232 | bool const isConfigDependent = cge->GetHadContextSensitiveCondition(); |
| 233 | |
| 234 | if (config && !isConfigDependent) { |
| 235 | return {}; |
| 236 | } |
| 237 | if (!config && isConfigDependent) { |
| 238 | this->RequiresConfigFiles = true; |
| 239 | return {}; |
| 240 | } |
| 241 | |
| 242 | std::string const& type = fileSet->GetType(); |
| 243 | if (config && (type == "CXX_MODULES"_s)) { |
| 244 | // C++ modules do not support interface file sets which are dependent |
| 245 | // upon the configuration. |
| 246 | cmMakefile* mf = gte->LocalGenerator->GetMakefile(); |
| 247 | std::ostringstream e; |
| 248 | e << "The \"" << gte->GetName() << "\" target's interface file set \"" |
| 249 | << fileSet->GetName() << "\" of type \"" << type |
| 250 | << "\" contains context-sensitive base file entries which is not " |
| 251 | "supported."; |
| 252 | mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); |
| 253 | return {}; |
| 254 | } |
| 255 | |
| 256 | cm::optional<std::string> dest = cmOutputConverter::EscapeForCMake( |
| 257 | unescapedDest, cmOutputConverter::WrapQuotes::NoWrap); |
| 258 | |
| 259 | if (!cmSystemTools::FileIsFullPath(unescapedDest)) { |
| 260 | dest = cmStrCat("@prefix@/"_s, *dest); |
| 261 | } |
| 262 | |
| 263 | return dest; |
| 264 | } |
| 265 | |
| 266 | bool cmExportInstallPackageInfoGenerator::GenerateFileSetProperties( |
| 267 | Json::Value& component, cmGeneratorTarget* gte, cmTargetExport const* te, |
no test coverage detected