cmTargetPropCommandBase: skip property setting if there's nothing to add

Some target types don't allow setting certain properties even if there
is no value being set there. Guard against this by avoiding property
setting when there is nothing to add.
This commit is contained in:
Ben Boeckel
2018-10-26 09:14:44 -04:00
parent 4201a11c2b
commit 9f64974f5e

View File

@@ -112,6 +112,9 @@ bool cmTargetPropCommandBase::PopulateTargetProperies(
const std::string& scope, const std::vector<std::string>& content,
bool prepend, bool system)
{
if (content.empty()) {
return true;
}
if (scope == "PRIVATE" || scope == "PUBLIC") {
if (!this->HandleDirectContent(this->Target, content, prepend, system)) {
return false;