View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0002597 | CMake | CMake | public | 2005-12-13 10:07 | 2010-12-14 13:09 | ||||
Reporter | Ken Moreland | ||||||||
Assigned To | Brad King | ||||||||
Priority | low | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | suspended | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0002597: Difference between ADD_CUSTOM_TARGET(DEPENDS...) and ADD_DEPENDENCIES unclear | ||||||||
Description | The ADD_CUSTOM_TARGET command has a DEPENDS option. There is also an ADD_DEPENDENCIES command that can be used to attach dependencies to a target created with ADD_CUSTOM_TARGET. One would think that the two methods of adding dependencies would be the same, but they are not. At best, this is a documentation bug. The documetation should clearly explain the difference between these two dependencies and when each would be used. I was told the difference is that one make dependencies on files and the other makes dependencies on targets. That is not a good enough explenation, as a make system target is usually just a rule to make a file. A more preferable fix would be to change CMake to be more forgiving about what type of dependency it is. That is, both methods should do the same thing, and they should both handle files and targets. For example, both should add a dependency for the file, and then add a dependency for the target if one exists. I've noticed the problem with the Unix Makefiles generator, but it may exist elsewhere. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0003406) Ken Martin (developer) 2005-12-13 15:43 |
All valid points but not a quick fix. One note though, while I haven't tested this, I believe the DEPENDS option for ADD_CUSTOM_TARGET will accept both target names and files. If so,then half the fix is already done. |
(0003407) Ken Moreland (reporter) 2005-12-13 15:58 |
I just tried this with version 2.2.3. When I have something of the form ADD_CUSTOM_TARGET(world DEPENDS hello) I get a dependency in CMakeFiles/world.dir/build.make for the world target to hello. I get no dependencies in CMakeFiles/Makefile2. If I try ADD_CUSTOM_TARGET(world) ADD_DEPENDENCIES(world hello) I get no dependencies in CMakeFiles/world.dir/build.make but I get a (sort of indirect) dependency in CMakeFiles/Makefile2 to build the hello.dir directory before the world.dir. I can't say I totally understand the setup for the new build system, but I think it would be benifical if both dependencies were built using either method for adding dependencies. I have no idea how hard that is to implement. |
(0005161) Bill Hoffman (manager) 2006-10-04 14:03 |
Is this still an issue? |
(0005200) Ken Moreland (reporter) 2006-10-04 17:58 |
I see the documentation for the DEPENDS option of ADD_CUSTOM_TARGET and ADD_DEPENDENCIES has been updated to make more clear the difference between the two. So in that sense, the problem is fixed. It would be nice however, if both depends mechanisms worked the same. In particular, I have run into instances where it would be convenient to use ADD_DEPENDENCIES to add a file dependency to an existing target after it has been created. But that is just a wish. There are probably technical reasons why that is not feasible, so it's OK to just close out this bug. |
(0023962) David Cole (manager) 2010-12-14 11:50 |
This is even better now. Brad has been working on some stuff relative to target dependencies that will first appear in the CMake 2.8.4 release next month... Assigning to Brad to take one last look over it. Brad, if everything seems good to you relative to all the notes/requests made in this bug, just close it out. Thanks |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2010-12-14 11:50 | David Cole | Note Added: 0023962 | |
2010-12-14 11:50 | David Cole | Assigned To | Ken Martin => Brad King |
2010-12-14 13:09 | Brad King | Status | assigned => closed |
2010-12-14 13:09 | Brad King | Resolution | open => suspended |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |