[CMake] help with variable usage in target_link_libraries

Alexander Neundorf a.neundorf-work at gmx.net
Sat Sep 5 12:02:59 EDT 2009


On Monday 31 August 2009, Eike Kroemer wrote:
> Hi Eric,
>
> > Variable values shoud be retrieve with curly brace, i.e.
> >
> > $LIBS --> ${LIBS}
>
> Yick, I had done that but not cited it correctly in my mail, sorry about
> that.
>
> > Then when you have a list of something you usually use LIST(APPEND
> >
> > LIST(APPEND LIBS "libN")
> >
> > even if
> >
> > SET(LIBS "${LIBS} libN") should work as well.
>
> list(APPEND ...) does the trick (while set doesn't), thanks!

SET(LIBS "${LIBS} libN") should give you one string "libA;libB libN", so you 
would link against "-llibA;libB libN" I think.
SET(LIBS ${LIBS} libN)
should work.

Alex


More information about the CMake mailing list