From 5daaa5c48dc6066b5bb145aff30286cc63c12e81 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 26 Jan 2013 11:04:12 +0100 Subject: Fix TARGET_PROPERTY target extractions. We need to make sure we can export targets which have content such as $<0:$ That means making not finding a target non-fatal here. --- Source/cmExportFileGenerator.cxx | 14 +++----------- Tests/ExportImport/Export/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 96e0aea..63756b1 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -367,7 +367,6 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpression( std::string::size_type lastPos = pos; cmMakefile *mf = target->GetMakefile(); - std::string errorString; while((pos = input.find("$AddTargetNamespace(targetName, target, missingTargets)) + if (this->AddTargetNamespace(targetName, target, missingTargets)) { - errorString = "$ requires " - "its first parameter to be a reachable target."; - break; + input.replace(nameStartPos, commaPos - nameStartPos, targetName); } - input.replace(nameStartPos, commaPos - nameStartPos, targetName); lastPos = pos + targetName.size(); } - if (!errorString.empty()) - { - mf->IssueMessage(cmake::FATAL_ERROR, errorString); - return; - } + std::string errorString; pos = 0; lastPos = pos; while((pos = input.find("$> $> $> + # Test that the below is non-fatal + $<$:$> ) set_property(TARGET testLibRequired APPEND PROPERTY -- cgit v0.12