[CMake] Unlinking a library at run time for an executable

Philip Lowman philip at yhbt.com
Fri Feb 27 13:13:08 EST 2009


On Fri, Feb 27, 2009 at 4:49 AM, ankit jain <ankitguddu at gmail.com> wrote:

> Hi ,
>
> I have defined a variable for a set of libraries that i want to link with
> some executables.
>
> But with one executble i dont want to use one of the library from the set
> of libraries.
>
> Can i unlink that particular library for this executable since iam using a
> variable for all those libraries.
>
> Eg:  Folder main Cmakelist
> set( var
>       path/l1.so
> path/l1.so
> path/l2.so
> path/l3.so
> path/l4.so
> path/l5.so
> path/l6.so
> path/l7.so
> path/l8.so
> path/l9.so)
>

Why not just do

set( some
      path/l1.so
path/l1.so
path/l2.so
path/l3.so
path/l4.so
path/l5.so
path/l6.so
path/l7.so
path/l8.so)
set( all ${some} path/l9.so)

add_executable(a1 a1.C)
target_link_libraries(a1 ${all})

add_executable(a2 a2.C)
target_link_libraries(a2 ${some})

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090227/7a5f5841/attachment.htm>


More information about the CMake mailing list