[CMake] Visual Studio 7.1 and ADD_DEPENDENCIES
Salvatore Iovene
salvatore.iovene+cmake at googlemail.com
Wed Nov 14 14:22:13 EST 2007
On Nov 14, 2007 9:14 PM, Brandon Van Every <bvanevery at gmail.com> wrote:
> On Nov 14, 2007 12:38 PM, Salvatore Iovene
> <salvatore.iovene+cmake at googlemail.com> wrote:
> >
> > On Nov 14, 2007 5:44 PM, Brandon Van Every <bvanevery at gmail.com> wrote:
> > > On Nov 14, 2007 7:12 AM, Salvatore Iovene
> > > <salvatore.iovene+cmake at googlemail.com> wrote:
> > > > Hi,
> > > > when I use CMake 2.4.7 to generate NMake Makefiles everything builds
> > > > fine, but if I generate Visual Studio 7.1 project files, and then open
> > > > the Visual Studio Solution, I notice that some things get linked just
> > > > for appearing as a dependency.
> > > >
> > > > ADD_DEPENDENCIES(my_lib my_otherlib), where both libs are STATIC,
> > > > will cause my_otherlib to be linked to my_lib even tho I didn't
> > > > explicitly request so using the TARGET_LINK_LIBRARY command. Is this a
> > > > bug or am I missing something?
> > >
> > > Perhaps a bug... but why are you specifying a dependency, if my_lib
> > > doesn't utilize my_otherlib?
> >
> > It _does_ use it. But if do both ADD_DEPENDENCIES and
> > TARGET_LINK_LIBRARY I'll end up with many many warnings about symbols
> > already defined, and ignoring because linking twice, which is
> > annoying. So, perhaps a bug?
>
> TARGET_LINK_LIBRARIES implies a dependency. You don't need to specify
> a 2nd one. I'd say the problem is the documentation of
> TARGET_LINK_LIBRARIES is too terse. It needs to mention implied
> dependencies for libraries you build. It also needs to mention the
> dependency behavior for -lsomelib flags; maybe there are none in that
> case? I suggest you file a "Severity = text" bug entitled
> "TARGET_LINK_LIBRARIES doesn't document implicit dependency" and
> whatever blah blah blah. Generally when filing "text" bugs, it's best
> to also write up what you think the docs should say.
Thanks, I'll report that.
--
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4 7D54 2864 359D FF20 16D8
More information about the CMake
mailing list