[CMake] help with variable usage in target_link_libraries

Eike Kroemer eike-michael.kroemer at atlas-elektronik.com
Mon Aug 31 02:35:35 EDT 2009


Hi there,

using cmake-2.6.4-Linux-i386, I'd like to use

  set(LIBS lib1)
  set(LIBS "$LIBS lib2")
  [...]
  set(LIBS "$LIBS libN")

  target_link_libraries(target $LIBS)

instead of writing explicitely

  target_link_libraries(target lib1 lib2 [...] libN)

but while cmake gives no error messages, the library dependencies are
not honored during link.
I tried to vary the usage of '"'s but to no avail.

How to do it correctly?

Thanks in advance,
  Eike


More information about the CMake mailing list