Xavier Delannoy wrote:
On Thu, 02 Feb 2006 15:02:00 +0000
Mike Talbot <[EMAIL PROTECTED]> wrote:

  
I believe that if you don't specify STATIC or SHARED in the ADD_LIBRARY 
command, then you can control whether libraries are built as shared or 
static via the BUILD_SHARED_LIBS variable.  If you set this to true in 
your cache, then all libraries in your project that aren't explicitly 
STATIC will be built as shared and vice-versa.

something like this should do it:

cd static_lib_dir
cmake -D BUILD_SHARED_LIBS:BOOL=FALSE ../srcdir

cd shared_lib_dir
cmake -D BUILD_SHARED_LIBS:BOOL=TRUE ../srcdir
    

this is exactly what I've tried.


  
I think the short answer to your question is that you need separate build directories for shared and static (otherwise you may get name clashes, e.g. windows .lib files are produced for both shared and static builds).

Alternatively, you could try setting up different build configurations for static and shared libraries from the same build directory - the output would go in different directories (as debug and release do).  However this may not be portable to generators that do not support multiple build configurations.  I'm not sure how to do this though.

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to