[Cmake] Linking libraries

Andy Cedilnik andy.cedilnik at kitware.com
Wed Dec 4 08:35:26 EST 2002


Hi Nils,

Make sure the ordering is correct.
For example, for TARGET_LINK_LIBRARIES you need a target, so it has to
be done after ADD_LIBRARY or ADD_EXECUTABLE. On the other hand,
LINK_LIBRARIES means from now on link all targets to this libraries,
which means it has to be done before target descriptions.

			Andy

On Wed, 2002-12-04 at 03:31, Nils H. Busch wrote:
> in a VTK related project, I have problems linking libraries other than
> those needed by VTK when building my own libraries. In a subdir, I build
> the resp lib and try to link it to libraries needed via LINK_LIBRARIES.
> This doesn't work. Only when I use TARGET_LINK_LIBRARIES the specified
> libs are linked into my target lib. Is this the intended behaviour,
> because I think I saw examples using LINK_LIBRARIES? What is the
> difference between those commands and when should either of them be used





More information about the CMake mailing list