MantisBT - CMake
View Issue Details
0012227CMakeCMakepublic2011-05-26 09:192013-10-07 10:03
AlexUA 
Stephen Kelly 
highmajoralways
closedfixed 
Allall
 
CMake 2.8.11 
0012227: Transitive dependencies and target properties
CMake have transitive dependecies of libraries linked to target. For example if A is static library wich depends from SomeLib. And target B is executable wich depends from A(will link both with A and SomeLib due to transitive dependency).
But the issue is that if we have some specific link_libraries() settings for A the target B won't link.
I've tryed to fix this manually through usage of additional target property like
TgLinkDirectories this property is set in target A and the used in all dependent targets.
But this solution will work only in some traverse orders (A->B which might be not the same in huge and complicated projects).

Actually I need the same functionality for include_directories().
This will help me achive of the functionality like in bjam.
Thanks in advance
No tags attached.
Issue History
2011-05-26 09:19AlexUANew Issue
2011-05-26 09:28AlexUANote Added: 0026617
2011-06-02 11:42Brad KingStatusnew => backlog
2011-06-02 11:44Brad KingNote Added: 0026653
2011-06-02 11:46Brad KingNote Added: 0026654
2011-06-02 11:49Brad KingNote Added: 0026655
2012-08-27 07:10Stephen KellyAssigned To => Stephen Kelly
2012-08-27 07:10Stephen KellyStatusbacklog => assigned
2013-03-13 11:51Stephen KellyNote Added: 0032604
2013-03-13 11:51Stephen KellyStatusassigned => resolved
2013-03-13 11:51Stephen KellyFixed in Version => CMake 2.8.11
2013-03-13 11:51Stephen KellyResolutionopen => fixed
2013-10-07 10:03Robert MaynardNote Added: 0033997
2013-10-07 10:03Robert MaynardStatusresolved => closed

Notes
(0026617)
AlexUA   
2011-05-26 09:28   
Please take into account that everything works fine for -l libs they transited correctly no matter for traverse order. According to manual they are defined in LINK_INTERFACE_LIBRARIES property and LINK_INTERFACE_LIBRARIES_<config> but in my case all this variables are empty.

It would be great if all target properties could be used with no matter of traverse order.
(0026653)
Brad King   
2011-06-02 11:44   
The LINK_INTERFACE_LIBRARIES property is something that you *set* to tell CMake not to transitively depend on every library linked to the target on which you set the property.

Note also that full target dependency analysis is not performed until after the configuration step has finished. It happens only during the generation step so the information is not available to the CMake langauge code in CMakeLists.txt files during configuration.
(0026654)
Brad King   
2011-06-02 11:46   
Here is a relevant thread from the mailing list:

  http://www.cmake.org/pipermail/cmake/2009-November/033196.html [^]
(0026655)
Brad King   
2011-06-02 11:49   
Currently we have no automatic usage requirement propagation except for linking. Other information about a given package XYZ gets passed by convention in variables called XYZ_INCLUDE_DIRS, XYZ_DEFINITIONS, etc. inside the CMake code of a project, or in package configuration files to cross project boundaries:

  http://www.cmake.org/Wiki/CMake/Tutorials#CMake_Packages [^]
(0032604)
Stephen Kelly   
2013-03-13 11:51   
CMake 2.8.11 has transitive handling of the include directories via the INTERFACE_INCLUDE_DIRECTORIES property, and compile_definitions via the INTERFACE_COMPILE_DEFINITIONS property.
(0033997)
Robert Maynard   
2013-10-07 10:03   
Closing resolved issues that have not been updated in more than 4 months.