[CMake] Link in dependencies in static library

Jeroen Dierckx jeroen.dierckx at gmail.com
Thu Oct 8 07:44:15 EDT 2009


Hi,
One of our static libraries is a thin C++ wrapper on top of expat. I want to
hide dealing with expat from the users of this library, which is no problem
as I can link in the static expat library with my lib. The user can just
include and link with my XmlParser library.

I linked the expat library with my static library in my cmake file
(target_link_libraries), but this isn't reflected in my Visual Studio 2008
project (Librarian/General/"Additional Dependencies" and "Additional Library
Directories"). This has the result that the users of my XmlParser library
have to link with expat themselves.

Is this a deliberate feature of cmake? I know that when using cmake as a
build system, expat is automatically linked when linking with my XmlParser
library, but in my opinion there should at least be an option to actually
link the dependencies in. Note that everything does work as expected when
building a SHARED library in stead of a STATIC one.

Greetz,
JeDi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091008/09b1cd46/attachment.htm>


More information about the CMake mailing list