[CMake] adding a link directory

Liam Kurmos quantum.leaf at gmail.com
Sun May 8 09:25:34 EDT 2011


Hi,

I've been using cmake to build vtk projects for some time, but i've
only really learnt the minimum i need.

Now i want to link against a single shared library.

until now i've added libraries with
eg.
TARGET_LINK_LIBRARIES(testOVAS vtkWidgets vtkRendering vtkHybrid vnl tourtre)

which has worked as i have lines like
FIND_PACKAGE(VXL)
FIND_PACKAGE(VTK REQUIRED)

however it wont work for tourtre as the linker cant find it.

i think one solution to add tourtre to my project might be to create a
FindTourtre.cmake but this process looks quite in depth and i only
wish to link a single shared library.

from the documentation i think it should be possible to do:

LINK_DIRECTORIES( ${LINK_DIRECTORIES} /absPath/libtourtre/)

but i still get lots of undefined references. I have tried a simple
example and linked it with -L/absPath/libtourtre/ -ltourtre and it
works fine so i'm at a loss where i'm going wrong.

your help will be much appreciated,

Liam


More information about the CMake mailing list