MantisBT - CMake
View Issue Details
0015174CMakeCMakepublic2014-09-28 09:442016-06-10 14:31
Marc Seebold 
Kitware Robot 
normalminoralways
closedmoved 
PCWindows7 x64
CMake 3.0.2 
 
0015174: TARGET_LINK_LIBRARIES adds libraries to INTERFACE_LINK_LIBRARIES without LINK_INTERFACE_LIBRARIES
TARGET_LINK_LIBRARIES(MYTARGET PRIVATE "mylib.lib")

adds "mylib.lib" to "INTERFACE_LINK_LIBRARIES" property of target "MYTARGET".
However, only in LINK_INTERFACE_LIBRARIES mode this property should be set.
TARGET_LINK_LIBRARIES(MYTARGET PRIVATE "mylib.lib")
Hotfix: SET_PROPERTY(TARGET MYTARGET PROPERTY INTERFACE_LINK_LIBRARIES "")
No tags attached.
Issue History
2014-09-28 09:44Marc SeeboldNew Issue
2014-09-28 11:48Marc SeeboldNote Added: 0036867
2014-09-29 09:01Brad KingNote Added: 0036869
2016-06-10 14:29Kitware RobotNote Added: 0042638
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0036867)
Marc Seebold   
2014-09-28 11:48   
MYTARGET is a static lib.
(0036869)
Brad King   
2014-09-29 09:01   
AFAICT this is behaving as intended. Read carefully through the documentation of target_link_libraries and CMP0022:

 http://www.cmake.org/cmake/help/v3.0/command/target_link_libraries.html [^]
 http://www.cmake.org/cmake/help/v3.0/policy/CMP0022.html#policy:CMP0022 [^]

The appearance of a PRIVATE dependency in INTERFACE_LINK_LIBRARIES should be wrapped in a $<LINK_ONLY:...> generator expression. It is an implementation detail required to tell consumers of MYTARGET that they need to link to 'mylib' but do not need other usage requirements.
(0042638)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.