supposedly you can do
ADD_DEFINITIONS(...)
ADD_LIBRARY(...)
REMOVE_DEFINITIONS(...)

which might work.

-- Mike Jackson Senior Research Engineer
Innovative Management & Technology Services


On Jul 7, 2008, at 12:09 PM, Yuri Timenkov wrote:



On Monday 07 July 2008 19:59:24 Mehdi Rabah wrote:
Hi,

I need to set multiple symbols in one of my target of my project. I can't use add_definitions because I don't want to define those variable for all
my targets, so I tried custom properties.

set_target_properties( target PROPERTIES DEFINE_SYMBOL VALUE1 VALUE2 )
doesn't work : the function doesn't expect this number of variables.

if I try :

set( var "VALUE1 VALUE2" ).
set_target_properties( target PROPERTIES DEFINE_SYMBOL  ${var} )

I get

c1xx : fatal error C1083: 'VALUE2': No such file or directory

I'm working with the microsoft compiler, and cmake 2.6.

Any thoughts ?
1) Write with single define symbol. For example, put into some header something
like this:
#ifdef MYTARGET_EXPORTS
#define VALUE1
#define VALUE2
#endif

2) use set_target_properties( target PROPERTIES COMPILE_FLAGS /DVALUE1
/DVALUE2 ).
(According to documentation CMake 2.6 supports this, otherwise set
COMPILE_FLAGS for particular source files).

The latter is not portable, so you have to choose proper flags for every
compiler.


Regards,
--
Mehdi

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake



_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to