View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015414CMakeCMakepublic2015-02-21 04:262015-11-02 09:13
ReporterStephen Kelly 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015414: Consider add_dependencies for INTERFACE libraries.
Descriptionhttps://github.com/Slicer/VTK/commit/f5dd079959ad050a80a59727ea556102cdb27d9f#commitcomment-9362165 [^]

http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/51780 [^]
TagsNo tags attached.
Attached Files

 Relationships
related to 0010395closedBrad King cannot use add_dependencies() for imported libraries (together with externalproject_add()) 

  Notes
(0038020)
Brad King (manager)
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 (manager)
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 (manager)
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 (manager)
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 (manager)
2015-11-02 09:13

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-02-21 04:26 Stephen Kelly New Issue
2015-02-23 09:18 Brad King Note Added: 0038020
2015-02-23 09:19 Brad King Target Version => CMake 3.3
2015-02-23 09:19 Brad King Description Updated
2015-03-27 15:52 Brad King Note Added: 0038355
2015-03-27 15:56 Brad King Relationship added related to 0010395
2015-03-27 15:57 Brad King Note Added: 0038356
2015-03-27 16:28 Brad King Note Added: 0038357
2015-03-27 16:28 Brad King Assigned To => Brad King
2015-03-27 16:28 Brad King Status new => resolved
2015-03-27 16:28 Brad King Resolution open => fixed
2015-03-27 16:28 Brad King Fixed in Version => CMake 3.3
2015-11-02 09:13 Robert Maynard Note Added: 0039751
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team