[CMake] Syntax of set_target_properties

Michael Hufer Michael.Hufer at swissrisk.com
Mon Nov 20 08:52:52 EST 2006


Hi,
set_taget_properties expects a single string after the COMPILE_FLAGS 
identifier. So, simply enclosing the flags in quotes should to the trick.

	Micha.

> Hello,
>
> Sylvain Benner wrote:
> > Have you tried this ?
> > set_target_properties( test PROPERTIES
> >                        COMPILE_FLAGS -DTEST -DDIR="./" )
> > Just an idea, I'm not sure it will work.
>
> Alexander wrote:
> > I think this should work.
> > set_target_properties( test PROPERTIES
> >                        COMPILE_FLAGS -DTEST
> >                        COMPILE_FLAGS -DDIR="./" )
> >
> > basically does
> >
> > target("test").compileFlags="-DTEST";
> > target("test").compileFlags="-DDIR=\"./\"";
> >
> > So if you want to append, you probably should use
> > GET_TARGET_PROPERTIES() first followed by SET_TARGET_PROPERTIES().
>
> It's not necessary to append target properties, I can add those with
> one line without problems.
>
> What I've now tried, like Sylvain suggested, is:
>
>   set_target_properties( test PROPERTIES
>                          COMPILE_FLAGS -DTEST -DDIR="./" )
>
>
> without success. CMake gives me the following error message:
>
>
> ---------------------------
> CMake Error: Error in cmake code at
> ........./src/CMakeLists.txt:101:
> SET_TARGET_PROPERTIES called with incorrect number of arguments.
> ....
> ---------------------------
>
>
> Any idea?
>
> Timo
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Michael Hufer        | EMail: mailto:Michael.Hufer at swissrisk.com
Software Developer   | WWW:   http://www.swissrisk.com
SWISSRISK AG         | Phone: ++49 69 50952 - 0


More information about the CMake mailing list