2007/1/25, Andreas Schneider <[EMAIL PROTECTED]>:
Eric Noulard wrote:
> Is there a way to build both shared AND static

Hi Eric,

yes there is. From the cmake documentation:

SET_TARGET_PROPERTIES

        When a library is built  CMake  by  default  generates  code  to
        remove  any  existing library using all possible names.  This is
        needed to support  libraries  that  switch  between  STATIC  and
        SHARED  by  a  user  option.   However when using OUTPUT_NAME to
        build a static and shared library of the same name using differ‐
        ent  logical  target  names  the  two  targets  will remove each
        other's  files.   This  can  be   prevented   by   setting   the
        CLEAN_DIRECT_OUTPUT property to 1.

RTFM.

Ok your are right I should have RTFFFFM.
Nevertheless I post here how to write such rule since I was puzzled by
the FM, before I understand how I should wriet it down.

So I managed to get both static and shared lib by writing:

ADD_LIBRARY(services-static STATIC ${SERVICE_SRC})
SET_TARGET_PROPERTIES(services-static
 PROPERTIES OUTPUT_NAME services
 CLEAN_DIRECT_OUTPUT 1)

then again

ADD_LIBRARY(services-dynamic DYNAMIC ${SERVICE_SRC})
SET_TARGET_PROPERTIES(services-dynamic
 PROPERTIES OUTPUT_NAME services
 CLEAN_DIRECT_OUTPUT 1)

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

Reply via email to