[CMake] OBJECT library and $<TARGET_OBJECTS:...>

Tom Kacvinsky tom.kacvinsky at vectorcast.com
Fri Sep 18 15:08:51 EDT 2015


Snippet:

add_libary(foo OBJECT a.c b.c)

add_custom_command(
  OUTPUT exports.def
  COMMAND lib /out:static.lib $<TARGET_OBJECTS:foo>
  COMMAND python export.py" static.lib exports.def
  DEPENDS export.py"
)

Results in:

CMake Error at CMakeLists.txt:289 (add_custom_command):
  Error evaluating generator expression:

    $<TARGET_OBJECTS:foo>

  Expression did not evaluate to a known generator expression

What am I doing wrong?  I am using cmake 2.8.11.2 on windows and my
understanding is that the TARGET_OBJECTS generator expression was
introduced in 2.8.8

Thanks,

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150918/356f2e5f/attachment.html>


More information about the CMake mailing list