View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002058CMakeCMakepublic2005-07-19 15:112005-08-05 13:06
ReporterAlex Neundorf 
Assigned ToKen Martin 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002058: check for usage of ADD_CUSTOM_COMMAND too simple

the makefile generator v3 reports warnings if the file generated via ADD_CUSTOM_COMMAND doesn't appear as a source file in any of the targets.
This is not enough, I get lots of invalid warnings.
I have two types of rules where this happens:
-the generation of moc files which are included in the source file instead of being compiled separatly
-the creation of an external library on which all sources depends, but which doesn't appear as a source file

In both cases the output of the ADD_CUSTOM_COMMAND is added via SET_SOURCE_FILES_PROPERTIES( OBJECT_DEPENDS) as a dependency to a source file.
So these manually added dependencies should also be checked before warning about unused custom rules.
Or it should be possible to disable this warning :-/
As it is, it makes the messages of cmake completely unusable, since everything is flooded by these (invalid) warnings.

TagsNo tags attached.
Attached Files


Bill Hoffman (manager)
2005-07-19 16:58

Sounds like the object_depends need to be checked.
Ken Martin (developer)
2005-07-20 13:06

OBJECT_DEPENDS is checked (line 64 of cmTarget.cxx) Are you sure these rules are used? The warning should only show up if the rules are not being used. It could be that these are extra rules and the required files are being generated by another set of rules. If you get the warning, but your build works, then grep -R in your build tree for the rule, to see where the rule is. The directory the rule is in will be the name of the target that is actually using the rule. A rule that isn't used by a target should not even be written to your binary tree, and I don't think they are.
Ken Martin (developer)
2005-07-20 13:07

Beforehand if you had extra rules that were not being used it silently ignored them, now it warns.
Ken Martin (developer)
2005-08-05 13:06

All custom commands are written for every target even if they are not used. This will be used in the future for chaining dependencies through generated header files (like for Qt 4)

 Issue History
Date Modified Username Field Change

Copyright © 2000 - 2018 MantisBT Team