[cmake-developers] target_include_directories branch in stage
Brad King
brad.king at kitware.com
Mon Nov 7 13:52:51 EST 2011
On 11/7/2011 12:57 PM, Brad King wrote:
> The INCLUDE_DIRECTORIES property of a target must be the *only* list
> from which the final include directory list is constructed. When a target
> is created the current directory-level include directories must be used
> to initialize the list. Further include_directories() calls in the same
> directory must append not only to the directory-level list but also to
> the property for all existing targets. At any intermediate point a
> target's property can be modified independently (see the set_property
> command example below).
Alex suggested the same thing:
http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/39090/focus=39227
On 11/7/2011 12:23 PM, Alexander Neundorf wrote:
> I think
> get_target_properties(someVar foo INCLUDE_DIRECTORIES)
> should return the full list of include directories used for that target.
>
> This would mean that they are not really additive.
>
> Instead, the INCLUDE_DIRECTORIES target property could be initialized from the
> directory-property INCLUDE_DIRECTORIES.
> Then, to add include dirs, use
> set_property(TARGET foo APPEND PROPERTY INCLUDE_DIRECTORIES ${bar_INCLUDES} )
>
> To set (and ignore any directory-level include dirs):
> set_property(TARGET foo PROPERTY INCLUDE_DIRECTORIES ${blub_INCLUDES} )
-Brad
More information about the cmake-developers
mailing list