View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015174CMakeCMakepublic2014-09-28 09:442016-06-10 14:31
ReporterMarc Seebold 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformPCOSWindowsOS Version7 x64
Product VersionCMake 3.0.2 
Target VersionFixed in Version 
Summary0015174: TARGET_LINK_LIBRARIES adds libraries to INTERFACE_LINK_LIBRARIES without LINK_INTERFACE_LIBRARIES
DescriptionTARGET_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.
Steps To ReproduceTARGET_LINK_LIBRARIES(MYTARGET PRIVATE "mylib.lib")
Additional InformationHotfix: SET_PROPERTY(TARGET MYTARGET PROPERTY INTERFACE_LINK_LIBRARIES "")
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0036867)
Marc Seebold (reporter)
2014-09-28 11:48

MYTARGET is a static lib.
(0036869)
Brad King (manager)
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 (administrator)
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.

 Issue History
Date Modified Username Field Change
2014-09-28 09:44 Marc Seebold New Issue
2014-09-28 11:48 Marc Seebold Note Added: 0036867
2014-09-29 09:01 Brad King Note Added: 0036869
2016-06-10 14:29 Kitware Robot Note Added: 0042638
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team