1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportInstallFileGenerator.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <memory>
#include <set>
#include <sstream>
#include <utility>
#include "cmExportSet.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmList.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetExport.h"
#include "cmValue.h"
cmExportInstallFileGenerator::cmExportInstallFileGenerator(
cmInstallExportGenerator* iegen)
: IEGen(iegen)
{
}
void cmExportInstallFileGenerator::ReplaceInstallPrefix(
std::string& input) const
{
cmGeneratorExpression::ReplaceInstallPrefix(input, this->GetInstallPrefix());
}
void cmExportInstallFileGenerator::PopulateImportProperties(
std::string const& config, std::string const& suffix,
cmTargetExport const* targetExport, ImportPropertyMap& properties,
std::set<std::string>& importedLocations)
{
this->SetImportLocationProperty(config, suffix,
targetExport->ArchiveGenerator, properties,
importedLocations);
this->SetImportLocationProperty(config, suffix,
targetExport->LibraryGenerator, properties,
importedLocations);
this->SetImportLocationProperty(config, suffix,
targetExport->RuntimeGenerator, properties,
importedLocations);
this->SetImportLocationProperty(config, suffix,
targetExport->ObjectsGenerator, properties,
importedLocations);
this->SetImportLocationProperty(config, suffix,
targetExport->FrameworkGenerator, properties,
importedLocations);
this->SetImportLocationProperty(config, suffix,
targetExport->BundleGenerator, properties,
importedLocations);
// If any file location was set for the target add it to the
// import file.
if (!properties.empty()) {
// Get the rest of the target details.
cmGeneratorTarget const* const gtgt = targetExport->Target;
this->SetImportDetailProperties(config, suffix, gtgt, properties);
// TODO: PUBLIC_HEADER_LOCATION
// This should wait until the build feature propagation stuff is done.
// Then this can be a propagated include directory.
// this->GenerateImportProperty(config, te->HeaderGenerator, properties);
}
}
std::string cmExportInstallFileGenerator::GetImportXcFrameworkLocation(
std::string const& config, cmTargetExport const* targetExport) const
{
std::string importedXcFrameworkLocation = targetExport->XcFrameworkLocation;
if (!importedXcFrameworkLocation.empty()) {
importedXcFrameworkLocation = cmGeneratorExpression::Preprocess(
importedXcFrameworkLocation,
cmGeneratorExpression::PreprocessContext::InstallInterface,
this->GetImportPrefixWithSlash());
importedXcFrameworkLocation = cmGeneratorExpression::Evaluate(
importedXcFrameworkLocation, targetExport->Target->GetLocalGenerator(),
config, targetExport->Target, nullptr, targetExport->Target);
if (!importedXcFrameworkLocation.empty() &&
!cmSystemTools::FileIsFullPath(importedXcFrameworkLocation) &&
!cmHasPrefix(importedXcFrameworkLocation,
this->GetImportPrefixWithSlash())) {
return cmStrCat(this->GetImportPrefixWithSlash(),
importedXcFrameworkLocation);
}
}
return importedXcFrameworkLocation;
}
bool cmExportInstallFileGenerator::GenerateImportFileConfig(
std::string const& config)
{
// Skip configurations not enabled for this export.
if (!this->IEGen->InstallsForConfig(config)) {
return true;
}
// Construct the name of the file to generate.
std::string fileName = cmStrCat(this->FileDir, '/', this->FileBase,
this->GetConfigFileNameSeparator());
if (!config.empty()) {
fileName += cmSystemTools::LowerCase(config);
} else {
fileName += "noconfig";
}
fileName += this->FileExt;
// Open the output file to generate it.
cmGeneratedFileStream exportFileStream(fileName, true);
if (!exportFileStream) {
std::string se = cmSystemTools::GetLastSystemError();
std::ostringstream e;
e << "cannot write to file \"" << fileName << "\": " << se;
cmSystemTools::Error(e.str());
return false;
}
exportFileStream.SetCopyIfDifferent(true);
std::ostream& os = exportFileStream;
// Generate the per-config target information.
this->GenerateImportConfig(os, config);
// Record this per-config import file.
this->ConfigImportFiles[config] = fileName;
return true;
}
void cmExportInstallFileGenerator::SetImportLocationProperty(
std::string const& config, std::string const& suffix,
cmInstallTargetGenerator* itgen, ImportPropertyMap& properties,
std::set<std::string>& importedLocations)
{
// Skip rules that do not match this configuration.
if (!(itgen && itgen->InstallsForConfig(config))) {
return;
}
// Get the target to be installed.
cmGeneratorTarget* target = itgen->GetTarget();
// Construct the installed location of the target.
std::string dest = itgen->GetDestination(config);
std::string value;
if (!cmSystemTools::FileIsFullPath(dest)) {
// The target is installed relative to the installation prefix.
value = std::string{ this->GetImportPrefixWithSlash() };
}
value += dest;
value += "/";
if (itgen->IsImportLibrary()) {
// Construct the property name.
std::string prop = cmStrCat("IMPORTED_IMPLIB", suffix);
// Append the installed file name.
value += cmInstallTargetGenerator::GetInstallFilename(
target, config, cmInstallTargetGenerator::NameImplibReal);
// Store the property.
properties[prop] = value;
importedLocations.insert(prop);
} else if (itgen->GetTarget()->GetType() == cmStateEnums::OBJECT_LIBRARY) {
// Construct the property name.
std::string prop = cmStrCat("IMPORTED_OBJECTS", suffix);
// Compute all the object files inside this target and setup
// IMPORTED_OBJECTS as a list of object files
std::vector<std::string> objects;
itgen->GetInstallObjectNames(config, objects);
for (std::string& obj : objects) {
obj = cmStrCat(value, obj);
}
// Store the property.
properties[prop] = cmList::to_string(objects);
importedLocations.insert(prop);
} else {
if (target->IsFrameworkOnApple() && target->HasImportLibrary(config)) {
// store as well IMPLIB value
auto importProp = cmStrCat("IMPORTED_IMPLIB", suffix);
auto importValue =
cmStrCat(value,
cmInstallTargetGenerator::GetInstallFilename(
target, config, cmInstallTargetGenerator::NameImplibReal));
// Store the property.
properties[importProp] = importValue;
importedLocations.insert(importProp);
}
// Construct the property name.
std::string prop = cmStrCat("IMPORTED_LOCATION", suffix);
// Append the installed file name.
if (target->IsAppBundleOnApple()) {
value += cmInstallTargetGenerator::GetInstallFilename(target, config);
value += ".app/";
if (!target->Makefile->PlatformIsAppleEmbedded()) {
value += "Contents/MacOS/";
}
value += cmInstallTargetGenerator::GetInstallFilename(target, config);
} else {
value += cmInstallTargetGenerator::GetInstallFilename(
target, config, cmInstallTargetGenerator::NameReal);
}
// Store the property.
properties[prop] = value;
importedLocations.insert(prop);
}
}
cmStateEnums::TargetType cmExportInstallFileGenerator::GetExportTargetType(
cmTargetExport const* targetExport) const
{
cmStateEnums::TargetType targetType = targetExport->Target->GetType();
// An OBJECT library installed with no OBJECTS DESTINATION
// is transformed to an INTERFACE library.
if (targetType == cmStateEnums::OBJECT_LIBRARY &&
!targetExport->ObjectsGenerator) {
targetType = cmStateEnums::INTERFACE_LIBRARY;
}
return targetType;
}
std::string const& cmExportInstallFileGenerator::GetExportName() const
{
return this->GetExportSet()->GetName();
}
void cmExportInstallFileGenerator::HandleMissingTarget(
std::string& link_libs, cmGeneratorTarget const* depender,
cmGeneratorTarget* dependee)
{
auto const& exportInfo = this->FindExportInfo(dependee);
auto const& exportFiles = exportInfo.first;
if (exportFiles.size() == 1) {
std::string missingTarget = exportInfo.second;
missingTarget += dependee->GetExportName();
link_libs += missingTarget;
this->MissingTargets.emplace_back(std::move(missingTarget));
} else {
// All exported targets should be known here and should be unique.
// This is probably user-error.
this->ComplainAboutMissingTarget(depender, dependee, exportFiles);
}
}
cmExportFileGenerator::ExportInfo cmExportInstallFileGenerator::FindExportInfo(
cmGeneratorTarget const* target) const
{
std::vector<std::string> exportFiles;
std::string ns;
auto const& name = target->GetName();
auto& exportSets =
target->GetLocalGenerator()->GetGlobalGenerator()->GetExportSets();
for (auto const& exp : exportSets) {
auto const& exportSet = exp.second;
auto const& targets = exportSet.GetTargetExports();
if (std::any_of(targets.begin(), targets.end(),
[&name](std::unique_ptr<cmTargetExport> const& te) {
return te->TargetName == name;
})) {
std::vector<cmInstallExportGenerator const*> const* installs =
exportSet.GetInstallations();
for (cmInstallExportGenerator const* install : *installs) {
exportFiles.push_back(install->GetDestinationFile());
ns = install->GetNamespace();
}
}
}
return { exportFiles, exportFiles.size() == 1 ? ns : std::string{} };
}
void cmExportInstallFileGenerator::ComplainAboutMissingTarget(
cmGeneratorTarget const* depender, cmGeneratorTarget const* dependee,
std::vector<std::string> const& exportFiles) const
{
std::ostringstream e;
e << "install(" << this->IEGen->InstallSubcommand() << " \""
<< this->GetExportName() << "\" ...) "
<< "includes target \"" << depender->GetName()
<< "\" which requires target \"" << dependee->GetName() << "\" ";
if (exportFiles.empty()) {
e << "that is not in any export set.";
} else {
e << "that is not in this export set, but in multiple other export sets: "
<< cmJoin(exportFiles, ", ") << ".\n";
e << "An exported target cannot depend upon another target which is "
"exported multiple times. Consider consolidating the exports of the "
"\""
<< dependee->GetName() << "\" target to a single export.";
}
this->ReportError(e.str());
}
void cmExportInstallFileGenerator::ComplainAboutDuplicateTarget(
std::string const& targetName) const
{
std::ostringstream e;
e << "install(" << this->IEGen->InstallSubcommand() << " \""
<< this->GetExportName() << "\" ...) "
<< "includes target \"" << targetName
<< "\" more than once in the export set.";
this->ReportError(e.str());
}
void cmExportInstallFileGenerator::ReportError(
std::string const& errorMessage) const
{
cmSystemTools::Error(errorMessage);
}
std::string cmExportInstallFileGenerator::InstallNameDir(
cmGeneratorTarget const* target, std::string const& config)
{
std::string install_name_dir;
cmMakefile* mf = target->Target->GetMakefile();
if (mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) {
auto const& prefix = this->GetInstallPrefix();
install_name_dir = target->GetInstallNameDirForInstallTree(config, prefix);
}
return install_name_dir;
}
std::string cmExportInstallFileGenerator::GetCxxModuleFile() const
{
return this->GetCxxModuleFile(this->GetExportSet()->GetName());
}
bool cmExportInstallFileGenerator::CollectExports(
std::function<void(cmTargetExport const*)> const& visitor)
{
auto pred = [&](std::unique_ptr<cmTargetExport> const& te) -> bool {
if (te->NamelinkOnly) {
return true;
}
if (this->ExportedTargets.insert(te->Target).second) {
visitor(te.get());
return true;
}
this->ComplainAboutDuplicateTarget(te->Target->GetName());
return false;
};
auto const& targets = this->GetExportSet()->GetTargetExports();
return std::all_of(targets.begin(), targets.end(), pred);
}
bool cmExportInstallFileGenerator::PopulateInterfaceProperties(
cmTargetExport const* targetExport, ImportPropertyMap& properties)
{
cmGeneratorTarget const* const gt = targetExport->Target;
std::string includesDestinationDirs;
this->PopulateInterfaceProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", gt,
cmGeneratorExpression::InstallInterface,
properties);
this->PopulateIncludeDirectoriesInterface(
gt, cmGeneratorExpression::InstallInterface, properties, *targetExport,
includesDestinationDirs);
this->PopulateLinkDirectoriesInterface(
gt, cmGeneratorExpression::InstallInterface, properties);
this->PopulateLinkDependsInterface(
gt, cmGeneratorExpression::InstallInterface, properties);
this->PopulateSourcesInterface(gt, cmGeneratorExpression::InstallInterface,
properties);
return this->PopulateInterfaceProperties(
gt, includesDestinationDirs, cmGeneratorExpression::InstallInterface,
properties);
}
namespace {
bool isSubDirectory(std::string const& a, std::string const& b)
{
return (cmSystemTools::ComparePath(a, b) ||
cmSystemTools::IsSubDirectory(a, b));
}
}
bool cmExportInstallFileGenerator::CheckInterfaceDirs(
std::string const& prepro, cmGeneratorTarget const* target,
std::string const& prop) const
{
std::string const& installDir =
target->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
std::string const& topSourceDir =
target->GetLocalGenerator()->GetSourceDirectory();
std::string const& topBinaryDir =
target->GetLocalGenerator()->GetBinaryDirectory();
std::vector<std::string> parts;
cmGeneratorExpression::Split(prepro, parts);
bool const inSourceBuild = topSourceDir == topBinaryDir;
bool hadFatalError = false;
for (std::string const& li : parts) {
size_t genexPos = cmGeneratorExpression::Find(li);
if (genexPos == 0) {
continue;
}
if (cmHasPrefix(li, this->GetImportPrefixWithSlash())) {
continue;
}
MessageType messageType = MessageType::FATAL_ERROR;
std::ostringstream e;
if (genexPos != std::string::npos) {
if (prop == "INTERFACE_INCLUDE_DIRECTORIES") {
switch (target->GetPolicyStatusCMP0041()) {
case cmPolicies::WARN:
messageType = MessageType::WARNING;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0041) << "\n";
break;
case cmPolicies::OLD:
continue;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
hadFatalError = true;
break; // Issue fatal message.
}
} else {
hadFatalError = true;
}
}
if (!cmSystemTools::FileIsFullPath(li)) {
/* clang-format off */
e << "Target \"" << target->GetName() << "\" " << prop <<
" property contains relative path:\n"
" \"" << li << "\"";
/* clang-format on */
target->GetLocalGenerator()->IssueMessage(messageType, e.str());
}
bool inBinary = isSubDirectory(li, topBinaryDir);
bool inSource = isSubDirectory(li, topSourceDir);
if (isSubDirectory(li, installDir)) {
// The include directory is inside the install tree. If the
// install tree is not inside the source tree or build tree then
// fall through to the checks below that the include directory is not
// also inside the source tree or build tree.
bool shouldContinue =
(!inBinary || isSubDirectory(installDir, topBinaryDir)) &&
(!inSource || isSubDirectory(installDir, topSourceDir));
if (prop == "INTERFACE_INCLUDE_DIRECTORIES") {
if (!shouldContinue) {
switch (target->GetPolicyStatusCMP0052()) {
case cmPolicies::WARN: {
std::ostringstream s;
s << cmPolicies::GetPolicyWarning(cmPolicies::CMP0052) << "\n";
s << "Directory:\n \"" << li
<< "\"\nin "
"INTERFACE_INCLUDE_DIRECTORIES of target \""
<< target->GetName()
<< "\" is a subdirectory of the install "
"directory:\n \""
<< installDir
<< "\"\nhowever it is also "
"a subdirectory of the "
<< (inBinary ? "build" : "source") << " tree:\n \""
<< (inBinary ? topBinaryDir : topSourceDir) << "\"\n";
target->GetLocalGenerator()->IssueMessage(
MessageType::AUTHOR_WARNING, s.str());
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
shouldContinue = true;
break;
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
break;
}
}
}
if (shouldContinue) {
continue;
}
}
if (inBinary) {
/* clang-format off */
e << "Target \"" << target->GetName() << "\" " << prop <<
" property contains path:\n"
" \"" << li << "\"\nwhich is prefixed in the build directory.";
/* clang-format on */
target->GetLocalGenerator()->IssueMessage(messageType, e.str());
}
if (!inSourceBuild) {
if (inSource) {
e << "Target \"" << target->GetName() << "\" " << prop
<< " property contains path:\n"
" \""
<< li << "\"\nwhich is prefixed in the source directory.";
target->GetLocalGenerator()->IssueMessage(messageType, e.str());
}
}
}
return !hadFatalError;
}
void cmExportInstallFileGenerator::PopulateSourcesInterface(
cmGeneratorTarget const* gt,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap& properties)
{
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
char const* const propName = "INTERFACE_SOURCES";
cmValue input = gt->GetProperty(propName);
if (!input) {
return;
}
if (input->empty()) {
properties[propName].clear();
return;
}
std::string prepro = cmGeneratorExpression::Preprocess(
*input, preprocessRule, this->GetImportPrefixWithSlash());
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, gt);
if (!this->CheckInterfaceDirs(prepro, gt, propName)) {
return;
}
properties[propName] = prepro;
}
}
void cmExportInstallFileGenerator::PopulateIncludeDirectoriesInterface(
cmGeneratorTarget const* target,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap& properties, cmTargetExport const& te,
std::string& includesDestinationDirs)
{
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
includesDestinationDirs.clear();
char const* const propName = "INTERFACE_INCLUDE_DIRECTORIES";
cmValue input = target->GetProperty(propName);
cmGeneratorExpression ge(*target->Makefile->GetCMakeInstance());
std::string dirs = cmGeneratorExpression::Preprocess(
cmList::to_string(target->Target->GetInstallIncludeDirectoriesEntries(te)),
preprocessRule, this->GetImportPrefixWithSlash());
this->ReplaceInstallPrefix(dirs);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
std::string exportDirs =
cge->Evaluate(target->GetLocalGenerator(), "", target);
if (cge->GetHadContextSensitiveCondition()) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::ostringstream e;
e << "Target \"" << target->GetName()
<< "\" is installed with "
"INCLUDES DESTINATION set to a context sensitive path. Paths which "
"depend on the configuration, policy values or the link interface "
"are "
"not supported. Consider using target_include_directories instead.";
lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (!input && exportDirs.empty()) {
return;
}
if ((input && input->empty()) && exportDirs.empty()) {
// Set to empty
properties[propName].clear();
return;
}
this->AddImportPrefix(exportDirs);
includesDestinationDirs = exportDirs;
std::string includes = (input ? *input : "");
char const* const sep = input ? ";" : "";
includes += sep + exportDirs;
std::string prepro = cmGeneratorExpression::Preprocess(
includes, preprocessRule, this->GetImportPrefixWithSlash());
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, target);
if (!this->CheckInterfaceDirs(prepro, target, propName)) {
return;
}
properties[propName] = prepro;
}
}
void cmExportInstallFileGenerator::PopulateLinkDependsInterface(
cmGeneratorTarget const* gt,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap& properties)
{
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
char const* const propName = "INTERFACE_LINK_DEPENDS";
cmValue input = gt->GetProperty(propName);
if (!input) {
return;
}
if (input->empty()) {
properties[propName].clear();
return;
}
std::string prepro = cmGeneratorExpression::Preprocess(
*input, preprocessRule, this->GetImportPrefixWithSlash());
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, gt);
if (!this->CheckInterfaceDirs(prepro, gt, propName)) {
return;
}
properties[propName] = prepro;
}
}
void cmExportInstallFileGenerator::PopulateLinkDirectoriesInterface(
cmGeneratorTarget const* gt,
cmGeneratorExpression::PreprocessContext preprocessRule,
ImportPropertyMap& properties)
{
assert(preprocessRule == cmGeneratorExpression::InstallInterface);
char const* const propName = "INTERFACE_LINK_DIRECTORIES";
cmValue input = gt->GetProperty(propName);
if (!input) {
return;
}
if (input->empty()) {
properties[propName].clear();
return;
}
std::string prepro = cmGeneratorExpression::Preprocess(
*input, preprocessRule, this->GetImportPrefixWithSlash());
if (!prepro.empty()) {
this->ResolveTargetsInGeneratorExpressions(prepro, gt);
if (!this->CheckInterfaceDirs(prepro, gt, propName)) {
return;
}
properties[propName] = prepro;
}
}
|