[CMake] An example of DEFINE_SYMBOL please

Mehdi Rabah mehdi.rabah at gmail.com
Fri Jul 11 11:34:27 EDT 2008


On Thu, Jul 10, 2008 at 12:43 PM, Yuri Timenkov <ytimenkov at parallels.com>
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.
> I just discovered nice feature: COMPILE_DEFINITIONS property.
> That is you can add custom defines to source files, targets or directories
> (with
> commands set_source_files_properties, set_target_properties and
> set_directory_properties commands accordingly).
>
> Moreover, COMPILE_DEFINITIONS can be configuration-specific, like
> COMPILE_DEFINITIONS_DEBUG.
>

Thanks,

I also discovered (in the doc) that cmake automatically define the
targetName_EXPORTS when compiling. I didn't tried it yet but it's exactly
what I need.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080711/74e84b5b/attachment.htm>


More information about the CMake mailing list