[CMake] howto include libs ?

Eric Noulard eric.noulard at gmail.com
Sun Feb 15 13:29:17 EST 2009

2009/2/15 Reinhard Thies <Reinhard.Thies at web.de>:
> Thanks,
> it helped, but now I get :
> Linking C executable ds309
> /usr/bin/ld: cannot find -llibconfuse
> collect2: ld returned 1 exit status
> and the lib is defenetly there. I assume it is not cmake related but do you
> still have an idea ?

I assume you are compiling on a Unix type host (may be linux)
then you should not add the "lib" prefix to you library.

thus you should not write:

TARGET_LINK_LIBRARIES(ds309 libconfuse)

but you should instead write:


this will end-up with a "-lconfuse"
which should work on most Unix platform.


More information about the CMake mailing list