[CMake] Setting "Link Library Dependencies" Flag in VS 2005
Malhotra, Anupam
Anupam.Malhotra at Safenet-inc.com
Mon May 5 08:32:45 EDT 2008
Hi Bill
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.
I hope this clarifies the exact situation. Please advise.
Thanks in advance.
Thanks and Regards
Anupam Malhotra
-----Original Message-----
From: Bill Hoffman [mailto:bill.hoffman at kitware.com]
Sent: Monday, May 05, 2008 5:22 PM
To: Malhotra, Anupam
Cc: cmake at cmake.org
Subject: Re: [CMake] Setting "Link Library Dependencies" Flag in VS 2005
Malhotra, Anupam wrote:
> Hi Bill
>
> I opened the .vcproj file being generated for my project in edit
> mode.Below is the section where the link library dependencies flag is
> being set:
>
> <Tool
> Name="VCLibrarianTool"
> LinkLibraryDependencies="false"
> OutputFile="E:\Nightly Build\Visual Studio 8
> 2005MT\core\client_library\output\MT\$(OutDir)\sntlsp_lsadmin.lib"
> />
>
> Note that I want to set this " LinkLibraryDependencies " flag to true
> using CMake. How can I achieve that?
>
Right now I don't think you can. What does this flag do? The help is
somewhat terse in devenv... It says "specifies whether or not library
outputs from project dependencies are automatically linked in." What
exactly does this do for you? There maybe a more portable "CMake" way
to do the same thing. Exactly what is your use case? Can you describe
a very simple project and how it uses this flag?
-Bill
The information contained in this electronic mail transmission
may be privileged and confidential, and therefore, protected
from disclosure. If you have received this communication in
error, please notify us immediately by replying to this
message and deleting it from your computer without copying
or disclosing it.
More information about the CMake
mailing list