[CMake] Problems with add_definitions()

Alexander Neundorf a.neundorf-work at gmx.net
Tue May 1 09:01:43 EDT 2007


On Tuesday 01 May 2007 07:05, Christian Ehrlicher wrote:
> Hi,
>
> I want to build a static and a dynamic lib from the same sources. It's
> no problem until we need to export some functions :)
>
> // this defines MAKE_SOLID_LIB (with set_target_properties) so we can
> use dllexport
> kde4_add_library(solid SHARED ${solid_LIB_SRCS})
>
> // this defines nothing -> dllimport is assumed
> kde4_add_library(solid_static STATIC ${solid_LIB_SRCS})
>
> I can't use add_definitions(-DSOLID_EXPORT=) here because it's added for
> both libs. I also can't use set_target_properties with DEFINE_SYMBOL
> because this is ignored when building a static lib...
>
> Any ideas how to solve this?

SET_TARGET_PROPERTIES( ... COMPILE_FLAGS ...)

Alex


More information about the CMake mailing list