[CMake] set_target_properties/include_directories

Tyler Roscoe tyler at cryptio.net
Thu Jun 25 12:12:39 EDT 2009


On Thu, Jun 25, 2009 at 04:57:55PM +0200, Micha Renner wrote:
> Is it possible to assign the include-directories to a target?
> Something like:
> 
> SET_TARGET_PROPERTIES(${_targetname} PROPERTIES
>  	INCLUDE_DIRECTORIES ....)
> 
> Would be logical, since it is the same way as with definitions
> 
> SET_TARGET_PROPERTIES(${_targetname} PROPERTIES COMPILE_DEFINITIONS ...)

I agree that this would be nice. I don't know of any way to do it now
(other than include_directories() of course).


Btw, I think the following may be a documentation bug. From
set_directory_properties():

"Set a property for the current directory and subdirectories. [...] The
properties include: INCLUDE_DIRECTORIES ..."

But then in the documentation for the directory property
INCLUDE_DIRECTORIES:

"This read-only property specifies the list of directories given so far
to the include_directories command. It is intended for debugging
purposes."


So is it read-only, or can you set it on directories?

Ok so I conducted an experiment and it appears that you *can* do
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES /some/dir). So
the second doc entry is incorrect and Micha you might be able to use
set_directory_properties() to do what you want.

tyler


More information about the CMake mailing list