[CMake] To avoid target_link_libraries magic

Valeriy Bykov valery.bickov at gmail.com
Mon Mar 21 10:12:56 EDT 2011


I'm using CMake version 2.8.4. Furthermore I use custom ToolChain but I
don't think it is important.

On Mon, Mar 21, 2011 at 10:05:08AM -0400, Brad King wrote:
> On 3/21/2011 9:42 AM, Valeriy Bykov wrote:
> > I'm trying to link with static library which I've found using FIND_LIBRARY:
> > MESSAGE (${LPTHREAD}) prints /home/vbykov/svn/builddeps/glibc/lib/libpthread.a
> >
> > Further I do the next:
> > ADD_EXECUTABLE (test_atomic_lock test_atomic_lock.c)
> > TARGET_LINK_LIBRARIES (test_atomic_lock ${LPTHREAD})
> >
> > But full path to the library turns into "-Bstatic -lpthread
> > -Bdynamic" magically
>
> What version of CMake are you using?  Since 2.6 the above example
> should link using the full path to the library.
>
> -Brad

--
С уважением,
Быков Валерий


More information about the CMake mailing list