Skip file-level dependencies on custom targets (#11332)

A custom command may name a target created by add_custom_target in its
DEPENDS field.  Treat this case as a target-level dependency only since
a custom target provides no standard file on which to add a file-level
dependency.
This commit is contained in:
Brad King
2010-12-08 17:05:23 -05:00
parent e30a775f68
commit ced1d5eccd
3 changed files with 5 additions and 8 deletions
+3 -4
View File
@@ -1878,10 +1878,9 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
break;
case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
// Depending on a utility target may not work but just trust
// the user to have given a valid name.
dep = inName;
return true;
// A utility target has no file on which to depend. This was listed
// only to get the target-level dependency.
return false;
case cmTarget::INSTALL_FILES:
case cmTarget::INSTALL_PROGRAMS:
case cmTarget::INSTALL_DIRECTORY: