MantisBT - CMake
View Issue Details
0015414CMakeCMakepublic2015-02-21 04:262015-11-02 09:13
Stephen Kelly 
Brad King 
normalminorhave not tried
closedfixed 
 
CMake 3.3CMake 3.3 
0015414: Consider add_dependencies for INTERFACE libraries.
https://github.com/Slicer/VTK/commit/f5dd079959ad050a80a59727ea556102cdb27d9f#commitcomment-9362165 [^]

http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/51780 [^]
No tags attached.
related to 0010395closed Brad King cannot use add_dependencies() for imported libraries (together with externalproject_add()) 
Issue History
2015-02-21 04:26Stephen KellyNew Issue
2015-02-23 09:18Brad KingNote Added: 0038020
2015-02-23 09:19Brad KingTarget Version => CMake 3.3
2015-02-23 09:19Brad KingDescription Updatedbug_revision_view_page.php?rev_id=1709#r1709
2015-03-27 15:52Brad KingNote Added: 0038355
2015-03-27 15:56Brad KingRelationship addedrelated to 0010395
2015-03-27 15:57Brad KingNote Added: 0038356
2015-03-27 16:28Brad KingNote Added: 0038357
2015-03-27 16:28Brad KingAssigned To => Brad King
2015-03-27 16:28Brad KingStatusnew => resolved
2015-03-27 16:28Brad KingResolutionopen => fixed
2015-03-27 16:28Brad KingFixed in Version => CMake 3.3
2015-11-02 09:13Robert MaynardNote Added: 0039751
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038020)
Brad King   
2015-02-23 09:18   
We already support add_dependencies for IMPORTED targets, and they just transitively forward through. The same could work for INTERFACE libraries.

Furthermore, if this isn't done already, we also need dependencies on INTERFACE libraries to forward through to any of the implementations behind those interfaces. This should work without an explicit add_dependencies when possible.
(0038355)
Brad King   
2015-03-27 15:52   
As mentioned in the mailing list thread linked in the description, this restriction was added by commit v3.0.0-rc1~175^2~20 (add_dependencies: Disallow use with INTERFACE_LIBRARY, 2013-12-25). The commit message does not have much detail on why. It was merged in a topic merged by commit v3.0.0-rc1~175 (Merge topic 'minor-cleanups', 2014-01-06).

I think the commit message is sparse because at the time it was a fairly obvious cleanup of the then-recently added INTERFACE library feature. The reason is that since INTERFACE libraries are not generated as build targets there can be no build-time dependency directly on them. Generated headers are expected to be provided by some other target that does build.

What is missing is that if another target in the same project consumes the generated headers through the INTERFACE library it should not have to know what other real target generates those headers. This is very similar to the use case of IMPORTED targets that have custom targets to generate them. As mentioned in 0015414:0038020, similar transitive forwarding of the dependencies should be added.
(0038356)
Brad King   
2015-03-27 15:57   
For reference, add_dependencies learned to support IMPORTED targets for issue 0010395:

 Allow add_dependencies() on imported targets
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e01cce28 [^]
(0038357)
Brad King   
2015-03-27 16:28   
Allow add_dependencies() on INTERFACE libraries
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac14cbf0 [^]
(0039751)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.