[CMake] building both static and dynamic versions of a library

Graham Clark gcla at crhc.uiuc.edu
Thu Jan 20 17:16:54 EST 2005


Hi everyone,

Our project consists of several executables, many of which use our own
libraries. We'd like some of these executables to be statically linked
against our libraries, and other executables to be dynamically
linked. Is it possible to have cmake build both static and dynamic
versions of a library? Using two ADD_LIBRARY statements in one
CMakeLists.txt file results in the first taking precedence and the
second being ignored.

Thanks a lot!
Graham


More information about the CMake mailing list