[CMake] SET_TARGET_PROPERTY for several definition ?

Alexander Neundorf a.neundorf-work at gmx.net
Tue Aug 15 06:56:04 EDT 2006


-------- Original-Nachricht --------
Datum: Tue, 15 Aug 2006 11:57:57 +0200
Von: "Antoine Tollenaere" <atollena at gmail.com>
An: cmake at cmake.org
Betreff: [CMake] SET_TARGET_PROPERTY for several definition ?

> Hi-
> 
> I'm looking for a way to properly define several symbols for only one
> C++ target.
> Currently I'm using something like:
> 
> ADD_LIBRARY(libsomething SHARED
>   sourcefile.cpp)
> 
> SET(LIBSOMETHING_DEFINES "FOO -DBAR")
> 
> SET_TARGET_PROPERTY(libsomething
>   DEFINE_SYMBOL "${LIBSOMETHING_DEFINES}")
> 
> Which is really ugly, as DEFINE_SYMBOL is intended for giving the name
> of the symbol defined for shared libraries (only one symbol). Anyway
> it works fine with Unix Makefiles.
> The problem is, when generating Visual Studio 7.1 projects, "FOO
> -DBAR" is taken as a single definitions, instead of two "FOO" and
> "BAR" definitions.
> Is there a clean way to define a bunch of symbols for only one target
> ? (ADD_DEFINITIONS is not suitable here because it affects all
> targets)

SET_TARGET_PROPERTIES( ... COMPILE_FLAGS...) new in cmake 2.4.2.

Bye
Alex

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the CMake mailing list