[CMake] Setting "Link Library Dependencies" Flag in VS 2005

Hisham Chowdhury hisham_chow at yahoo.com
Sat Aug 15 03:25:59 EDT 2009


Hello Clint,
Thanks for your response. I am still not able to link all the dependent libraries to the desired target. My scenario is little bit different. In my case A, B and C all are static lib(no exe's). So what I am doing in the cmake file is:
add_dependencies(A,B,C)
target_link_libraries(A,B,C)

but i don't see any change in the size of A (so B and C is not linked in). So, when i copy only A to my target directory, the symbols from B and C are not found
any help is greatly appreciated.

Thanks,
Hisham


--- On Fri, 8/14/09, Clinton Stimpson <clinton at elemtech.com> wrote:

> From: Clinton Stimpson <clinton at elemtech.com>
> Subject: Re: [CMake] Setting "Link Library Dependencies" Flag in VS 2005
> To: "Hisham Chowdhury" <hisham_chow at yahoo.com>
> Cc: cmake at cmake.org
> Date: Friday, August 14, 2009, 4:00 AM
> 
> The answer is here:
> http://www.cmake.org/pipermail/cmake/2008-December/025814.html
> Is that the same thread you're referring to?
> Hint:  use target_link_libraries instead of
> add_dependency.
> 
> Clint
> 
> Hisham Chowdhury wrote:
> > Hello,
> > I saw this issue in one of the email thread online. I
> am also facing the same issue. So, I am wondering, were
> anybody able to solve this issue?
> >
> > Problem description(from email from Anupam Malhotra):
> > Let me tell u a small example:
> >
> > I have a project say master.sln and in that solution I
> am having 3
> > different projects(.vcproj) which are making three
> libraries:
> > a.lib,b.lib,c.lib.
> >
> > Now using the command ADD_DEPENDENCIES, I am setting
> the project
> > dependencies to specify that a.lib depends on b.lib
> and c.lib. Whenever
> > we build a.lib, this would build b.lib and c.lib
> before it actually
> > builds a.lib since b.lib and c.lib are the
> dependencies.
> >
> > In Visual Studio 6, once we specify these dependencies
> , after a.lib is
> > built, all the symbols in b.lib and c.lib are linked
> into a.lib
> > automatically. So in this case if I want to use a,b,c
> in another exe
> > (say myexe), I can just link to a.lib. In this case
> b.lib and c.lib will
> > automatically be linked into myexe
> >
> > However in VS 2005, b.lib and c.lib are not
> automatically linked into
> > a.lib. So while building a.lib, we have to turn this
> parameter(Link
> > Library Dependencies) on. If this parameter is turned
> off and we try to
> > link a.lib with myexe, we get errors for all the
> symbols belonging to
> > b.lib and c.lib since they are not linked into a.lib.
> >
> > Can anybody please help me on how to force b and c to
> link with a for Vstudio2005/2008  using cmake?
> >
> >
> > Thanks,
> > Hisham
> >
> >
> >       
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ
> at: http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
> >   
> 
> 


      


More information about the CMake mailing list