**SPAM** Re: [CMake] Syntax of set_target_properties

Timo Rumland cr at olympclan.de
Mon Nov 20 08:12:58 EST 2006


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




More information about the CMake mailing list