[CMake] Cmake 2.6.0 release and _Util project on Visual studio 2003

Bill Hoffman bill.hoffman at kitware.com
Fri May 9 09:04:24 EDT 2008


Markus Israelsson wrote:
> Of course I forgot to add.
> 
> None of the libraries are static. They are all SHARED. That is why it
> confuses me. I have always used visual studio dependencies to build them
> in a certain order. Also the dependency in visual studio means that
> library A that uses features of library B which it depends on can find
> the symbols in library B (find and link with the lib) without having to
> state explicitly in the link libraries properties that it should. This
> is true for all versions of microsoft visual studio that I have ever
> worked with (vc7, vc8 and vc9).
> 
> I guess that this is not what CMake mean with ADD_DEPENDENCIES.
> 

OK, same thing as the static then. ADD_DEPENDENCIES should only affect 
build order, and not change linking at all.   You should use 
target_link_libraries for that.  What you had would not have worked for 
nmake or any makefile build of CMake, but only visual studio.


So, you want:

TARGET_LINK_LIBRARIES( FirstProject SecondProject )

-Bill


More information about the CMake mailing list