Am Sonntag, 8. Mai 2011, 14:25:34 schrieb Liam Kurmos: > 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/)
Don't use LINK_DIRECTORIES. TARGET_LINK_LIBRARIES(testOVAS /absPath/libtourtre/libtourtre.so) Or even better FIND_LIBRARY(TOURTRE_LIBRARY tourtre /absPath/libtourtre) TARGET_LINK_LIBRARIES(testOVAS ${TOURTRE_LIBRARY}) Which is half of what you need for a FindTourtre.cmake. Eike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake