Am 16.10.2012 12:43, schrieb Robert Bielik:
Hi all, I haven't found the answer to this: I have a static library A
that uses static library B, but when I create an executable C I only
want to link with A.
AFAIK you have to link C also with B.
You might add a target_link_libraries(C B) in C's configuration.

A non portable way to avoid this configuration could be to
use automatic linking directives in A's headers included by C.


In Visual Studio this is accomplished by adding library B to "Additional
Dependencies" (Librarian/General), but how can I make CMake create that
dependency ?
When you add B to the Additional Dependencies, C is linked with B.

Actually, "target_link_libraries(C B)" puts B into the
Additional Dependencies of the VC project generated for C.

HTH
Titus

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to