How would it not be additive?<div><br></div><div>get_target_property() for INCLUDE_DIRECTORIES would return target includes + directory includes (that apply to that target, transitively)</div><div><br></div><div>I don't know if preprocessor definitions follow this but this is the behavior I would expect.<br clear="all">
<div><br></div><div>---------</div>Robert Dailey<br>
<br><br><div class="gmail_quote">On Mon, Nov 7, 2011 at 11:23 AM, Alexander Neundorf <span dir="ltr"><<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Friday 04 November 2011, David Cole wrote:<br>
</div><div><div class="h5">> On Wed, Nov 2, 2011 at 8:30 PM, Stephen Kelly <<a href="mailto:steveire@gmail.com">steveire@gmail.com</a>> wrote:<br>
> > David Cole wrote:<br>
> >> On Tue, Nov 1, 2011 at 4:33 PM, Robert Dailey<br>
> >><br>
> >> <<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>> wrote:<br>
> >>> On Tue, Nov 1, 2011 at 3:32 PM, David Cole<br>
> >>><br>
> >>> <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> >>>> Not yet<br>
> >>><br>
> >>> Meaning there are plans in the works to add such functionality in the<br>
> >>> near future?<br>
> >>> For now I guess I could actually hard code VS environment variables in<br>
> >>> my include directory strings, such as $(Configuration).<br>
> >><br>
> >> There is a feature planned to add per-target include directories (as a<br>
> >> target property). As part of that work, we will probably naturally<br>
> >> also add per-configuration values of that new target property. It is<br>
> >> not yet added as a feature request in the bug tracker, but there are<br>
> >> related ones that I may "borrow" for the purpose. Stay tuned for more<br>
> >> info, but it is not coming in the next week or two. Hopefully, in time<br>
> >> for 2.8.7, but it depends on timing at this point.... so no promises.<br>
> ><br>
> > Hi David,<br>
> ><br>
> > I'm interested in this feature. I'd like to get it into CMake 2.8.7.<br>
> ><br>
> > It came up in the recent thread about how Qt5Config.cmake should work:<br>
> ><br>
> > <a href="http://thread.gmane.org/gmane.comp.lib.qt.project.devel/79/focus=226" target="_blank">http://thread.gmane.org/gmane.comp.lib.qt.project.devel/79/focus=226</a><br>
> ><br>
> > You mentioned that there are some side-line relevant bugs in the CMake<br>
> > tracker for this. Could you point me to them? Could you also indicate the<br>
> > approximate location in the code to look to for starting to work on this<br>
> > (cmTarget.cxx?).<br>
><br>
> See these bugs (and probably others, too, but these looked like the<br>
> most relevant ones when I searched for "include_directories"...)<br>
><br>
> <a href="http://public.kitware.com/Bug/view.php?id=1968" target="_blank">http://public.kitware.com/Bug/view.php?id=1968</a><br>
> <a href="http://public.kitware.com/Bug/view.php?id=6269" target="_blank">http://public.kitware.com/Bug/view.php?id=6269</a><br>
> <a href="http://public.kitware.com/Bug/view.php?id=6493" target="_blank">http://public.kitware.com/Bug/view.php?id=6493</a><br>
> <a href="http://public.kitware.com/Bug/view.php?id=8189" target="_blank">http://public.kitware.com/Bug/view.php?id=8189</a><br>
><br>
> I think the main thing we want is a new target property named<br>
> "INCLUDE_DIRECTORIES" - There's already a directory property with that<br>
> name; the include_directories command is implemented in terms of that<br>
> directory property. Along with that, we will also want<br>
> per-configuration variants of the property, similar to the many<br>
> existing target properties that have per-config variants.<br>
><br>
> If you look at the code, you'll see that use of the existing<br>
> INCLUDE_DIRECTORIES property triggers a call to<br>
> cmMakefile::SetIncludeDirectories, which just saves it in a data<br>
> member for later use. You can grep the code for GetIncludeDirectories<br>
> for callers, or for just IncludeDirectories to see the direct usage in<br>
> cmMakefile.cxx itself.<br>
><br>
> The interesting bits here are going to be in deciding how to make<br>
> these per-target include_directories behave. Should they be additive?<br>
> Or should they override the directory-level includes entirely?<br>
<br>
</div></div>I think<br>
get_target_properties(someVar foo INCLUDE_DIRECTORIES)<br>
should return the full list of include directories used for that target.<br>
<br>
This would mean that they are not really additive.<br>
<br>
Instead, the INCLUDE_DIRECTORIES target property could be initialized from the<br>
directory-property INCLUDE_DIRECTORIES.<br>
Then, to add include dirs, use<br>
set_property(TARGET foo APPEND PROPERTY INCLUDE_DIRECTORIES ${bar_INCLUDES} )<br>
<br>
To set (and ignore any directory-level include dirs):<br>
set_property(TARGET foo PROPERTY INCLUDE_DIRECTORIES ${blub_INCLUDES} )<br>
<br>
Alex<br>
<div class="HOEnZb"><div class="h5">--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>