[CMake] Efficient linking to libraries(static and dynamic)

ankit jain ankitguddu at gmail.com
Wed Feb 11 01:01:18 EST 2009


Hi all,

I have folder f1 having csome cpp files. structure is like this:
f1
....c1.cpp
....c2.cpp

now i create an executable for it as
add_executable(myexe c1.cpp c2.cpp)

the path of f1 folder is /home/ankit/mycode/f1
now i want to link myexe to a library lib.so and lib1.a which are not in
this folder but resides in other folder suppose in lib whose path is
something like this:

/home/ankit/mycode/lib/lib.so
/home/ankit/mycode/lib/lib1.a

How to do achieve this linkage so that no unref came.
Right now iam doing it usinmg target_link_libraries by giving the entire
path somthing like this:

target_link_libraries(myexe /home/ankit/mycode/lib/lib.so
/home/ankit/mycode/lib/lib1.a)

but it gives some unrefs. i dont know why.

Can u tell me how to achieve it.

Regards-
Ankit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090211/c2930e2e/attachment-0001.htm>


More information about the CMake mailing list