[CMake] static library dependences in MSVC

David Purton david at haeseandharris.com.au
Tue Aug 1 02:48:28 EDT 2006


Hi,

I have a project that has a number of interdependent libraries and and
then applications that depend on them. Because of the way I distribute
the applications I build everything statically.

I notice that when you generate makefiles, dependencies between the
libraries seem to be handled well. So if I change a header in one
library, then those libraries that include this header get rebuilt, then
any apps depending on all rebuilt libraries get rebuilt, etc.

However, this doesn't work with Visual Studio. I see that there is a
line in cmGlobalVisualStudio71Generator.cxx that looks like this:

  if (target.GetType() != cmTarget::STATIC_LIBRARY)
  {
    // do dependency stuff
  }

So of course the dependency info is not included in the sln file for my
static libraries.


My questions are:

1) Why is this done this way?

2) Will bad things happen if I take the 'if' statement out?


It seems to work ok, but I have only been playing with CMake and Visual
Studio for a few days...


cheers

dc

-- 
David Purton
Haese & Harris Publications
Phone: +61 8 8355 9444    Email: david at haeseandharris.com.au
Fax:   +61 8 8355 9471    Web:   http://www.haeseandharris.com.au/


More information about the CMake mailing list