[cmake-developers] [CMake 0015299]: CMakeExpandImportedTargets does not support generator expression TARGET_PROPERTY w/o target specified
Mantis Bug Tracker
mantis at public.kitware.com
Thu Dec 11 06:36:02 EST 2014
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=15299
======================================================================
Reported By: Paweł Stankowski
Assigned To:
======================================================================
Project: CMake
Issue ID: 15299
Category: Modules
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2014-12-11 06:36 EST
Last Modified: 2014-12-11 06:36 EST
======================================================================
Summary: CMakeExpandImportedTargets does not support
generator expression TARGET_PROPERTY w/o target specified
Description:
CMakeExpandImportedTarget expands target names to file paths including targets
from IMPORTED_LINK_INTERFACE_LIBRARIES* properties of expanded targets.
However, IMPORTED_LINK_INTERFACE_LIBRARIES property may contain generator
expression $<TARGET_PROPERTY:prop>. It should be converted to
$<TARGET_PROPERTY:target,prop> expression. Otherwise following error will
appear:
"$<TARGET_PROPERTY:prop> may only be used with targets. It may not be used
with add_custom_command. Specify the target to read a property from using
the $<TARGET_PROPERTY:tgt,prop> signature instead".
BTW: INTERFACE_LINK_LIBRARIES property should be preferred,
IMPORTED_LINK_INTERFACE_LIBRARIES should not be used when the former is defined.
Currently INTERFACE_LINK_LIBRARIES property is ignored.
Steps to Reproduce:
This is easily reproducible on Windows with Qt libraries.
For example, Qt5 adds following generator expression in
IMPORTED_LINK_INTERFACE_LIBRARIES of Qt targets:
$<$<AND:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>,$<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>,$<NOT:$<BOOL:$<TARGET_PROPERTY:Qt5_NO_LINK_QTMAIN>>>,$<TARGET_POLICY:CMP0020>>:Qt5::WinMain>;C:/Qt5/5.3/msvc2013_opengl/bin/Qt5Networkd.dll;C:/Qt5/5.3/msvc2013_opengl/bin/Qt5Cored.dll;$<$<AND:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>,$<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>,$<NOT:$<BOOL:$<TARGET_PROPERTY:Qt5_NO_LINK_QTMAIN>>>,$<TARGET_POLICY:CMP0020>>:Qt5::WinMain>
Qt4 does similar thing.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2014-12-11 06:36 Paweł StankowskiNew Issue
======================================================================
More information about the cmake-developers
mailing list