[CMake] how to use external gnu make library

Jan Woetzel jw at woetzelweb.de
Tue Mar 14 05:26:37 EST 2006


kdsfinger at gmail.com wrote:



> c++    -fPIC "CMakeFiles/test1.dir/main.o"   -o test1 -rdynamic 
> -lgsl_sf_bessel_j0
> /usr/bin/ld: cannot find -lgsl_sf_bessel_j0


You should read the output - the lib is not found.
Have  a look at the find script and you will get the idea to use teh 
GSL_LIBRARIES variable.

> TARGET_LINK_LIBRARIES(test1 gsl_sf_bessel_j0)

E.g.
TARGET_LINK_LIBRARIES(test1 ${GSL_LIBRARIES})

Otherwise add LINK:DIRECTORIES

Jan.

-- 

  Dipl.-Ing. Jan Woetzel
--------------------------------------------------
  Uni Kiel
  Institut f. Informatik und Praktische Mathematik
  Hermann-Rodewaldstr. 3  [Raum 310]
  24098 Kiel/Germany
--------------------------------------------------
  Tel    +49-431-880-4477
  Fax    +49-431-880-4054
  Privat +49-431-802872
  Mob.   +49-179-2937346
--------------------------------------------------
  Url    www.mip.informatik.uni-kiel.de/~jw
  Email  jw at mip.informatik.uni-kiel.de
  Privat jw at WoetzelWeb.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060314/7259c387/attachment.htm


More information about the CMake mailing list