[cmake-developers] [CMake 0015338]: Querying for (deprecated) LOCATION property prevents expansion of TARGET_OBJECTS generator expression

Mantis Bug Tracker mantis at public.kitware.com
Tue Jan 6 10:23:20 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15338 
====================================================================== 
Reported By:                Matthias Maier
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15338
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-01-06 10:23 EST
Last Modified:              2015-01-06 10:23 EST
====================================================================== 
Summary:                    Querying for (deprecated) LOCATION property prevents
expansion of TARGET_OBJECTS generator expression
Description: 
Consider the following minimal project:

foo.cc
    int main () {}

CMakeLists.txt$<TARGET_OBJECTS:foo>
    add_library(foo OBJECT foo.cc)
    add_executable(bar $<TARGET_OBJECTS:foo>)
    get_target_property(location bar LOCATION)

Starting with CMake 3.1 above example fails with an error message ("CMake Error:
CMake can not determine linker language for target: bar") because the generator
expression "$<TARGET_OBJECTS:foo>" does not get expanded and thus the final link
line is empty.

Not querying for the LOCATION property fixes this.
This bug is not present in CMake 3.0.* or 2.8.*.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-01-06 10:23 Matthias Maier New Issue                                    
======================================================================



More information about the cmake-developers mailing list