[CMake] SET_SOURCE_FILES_PROPERTIES

Brad King brad.king at kitware.com
Fri Mar 10 09:15:35 EST 2006


James Bigler wrote:
> I'm using CMake 2.2.3, swig 1.3.28 on Suse Linux 9.3.
> 
> I want to set a couple of different options for a swig interface file 
> I'm compiling:
> 
> # This is all on a single line if my email program munges it.
> SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES SWIG_FLAGS "-Wall 
> -DSCI_NOPERSISTENT")
> 
> 
> Well, when it runs the command it adds a "\" after "-Wall":
> 
> /usr/local/bin/swig -python -Wall\ -DSCI_NOPERSISTENT ...
> 
> Which causes swig to barf.
> 
> Note that this works:
> 
> /usr/local/bin/swig -python -Wall -DSCI_NOPERSISTENT ...
> 
> How do I specify multiple arguments to swig from CMake (one is fine)?

I think the swig macros treat the SWIG_FLAGS property as a list and not 
a string, so you should specify a semicolon separated set of flags:

SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES
   SWIG_FLAGS "-Wall;-DSCI_NOPERSISTENT")

-Brad



More information about the CMake mailing list