[CMake] per target flags

Egon Kocjan egon at krul.ath.cx
Mon Mar 17 04:19:20 EDT 2008


On Mon, 2008-03-17 at 02:21 +0100, Pau Garcia i Quiles wrote:
> Quoting Egon Kocjan <egon at krul.ath.cx>:
> 
> > Are/will-be there per target commands for adding include directories and
> > preproc. defines?
> 
> SET_DIRECTORY_PROPERTIES
> SET_SOURCE_FILES_PROPERTIES
> SET_TARGET_PROPERTIES
> 
> You may also want to take a look at this page:
> http://www.cmake.org/Wiki/CMake_Useful_Variables

Yes, I did RTFM before asking, I came up with this:
GET_TARGET_PROPERTY(_TMP TGT COMPILE_FLAGS)
SET_TARGET_PROPERTIES(TGT PROPERTIES COMPILE_FLAGS "${_TMP} -Isome_dir
-Dsomething=3")

But this seems wrong to me, I assumed there's a better way. Like:

TARGET_ADD_INCLUDES(TGT some_dir1 some_dir2)




More information about the CMake mailing list