diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index ddcc39d68d..db1d180eca 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -841,6 +841,8 @@ getLinkedTargetsContent( context->HadContextSensitiveCondition = true; } } + linkedTargetsContent = + cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent); return linkedTargetsContent; } @@ -1100,9 +1102,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } } - linkedTargetsContent = - cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent); - if (!prop) { if (target->IsImported()