[CMake] SET_TARGET_PROPERTY for several definition ?

Antoine Tollenaere atollena at gmail.com
Tue Aug 15 05:57:57 EDT 2006


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)

Regards,
Antoine Tollenaere


-- 
Jabber ID : atollena at fritalk.com
tel : +33 6 86 75 99 35


More information about the CMake mailing list