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&#39;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">&lt;<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>&gt;</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">&gt; On Wed, Nov 2, 2011 at 8:30 PM, Stephen Kelly &lt;<a href="mailto:steveire@gmail.com">steveire@gmail.com</a>&gt; wrote:<br>
&gt; &gt; David Cole wrote:<br>
&gt; &gt;&gt; On Tue, Nov 1, 2011 at 4:33 PM, Robert Dailey<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt; &gt;&gt;&gt; On Tue, Nov 1, 2011 at 3:32 PM, David Cole<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt; &gt;&gt;&gt;&gt; Not yet<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Meaning there are plans in the works to add such functionality in the<br>
&gt; &gt;&gt;&gt; near future?<br>
&gt; &gt;&gt;&gt; For now I guess I could actually hard code VS environment variables in<br>
&gt; &gt;&gt;&gt; my include directory strings, such as $(Configuration).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; There is a feature planned to add per-target include directories (as a<br>
&gt; &gt;&gt; target property). As part of that work, we will probably naturally<br>
&gt; &gt;&gt; also add per-configuration values of that new target property. It is<br>
&gt; &gt;&gt; not yet added as a feature request in the bug tracker, but there are<br>
&gt; &gt;&gt; related ones that I may &quot;borrow&quot; for the purpose. Stay tuned for more<br>
&gt; &gt;&gt; info, but it is not coming in the next week or two. Hopefully, in time<br>
&gt; &gt;&gt; for 2.8.7, but it depends on timing at this point.... so no promises.<br>
&gt; &gt;<br>
&gt; &gt; Hi David,<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m interested in this feature. I&#39;d like to get it into CMake 2.8.7.<br>
&gt; &gt;<br>
&gt; &gt; It came up in the recent thread about how Qt5Config.cmake should work:<br>
&gt; &gt;<br>
&gt; &gt; <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>
&gt; &gt;<br>
&gt; &gt; You mentioned that there are some side-line relevant bugs in the CMake<br>
&gt; &gt; tracker for this. Could you point me to them? Could you also indicate the<br>
&gt; &gt; approximate location in the code to look to for starting to work on this<br>
&gt; &gt; (cmTarget.cxx?).<br>
&gt;<br>
&gt; See these bugs (and probably others, too, but these looked like the<br>
&gt; most relevant ones when I searched for &quot;include_directories&quot;...)<br>
&gt;<br>
&gt;   <a href="http://public.kitware.com/Bug/view.php?id=1968" target="_blank">http://public.kitware.com/Bug/view.php?id=1968</a><br>
&gt;   <a href="http://public.kitware.com/Bug/view.php?id=6269" target="_blank">http://public.kitware.com/Bug/view.php?id=6269</a><br>
&gt;   <a href="http://public.kitware.com/Bug/view.php?id=6493" target="_blank">http://public.kitware.com/Bug/view.php?id=6493</a><br>
&gt;   <a href="http://public.kitware.com/Bug/view.php?id=8189" target="_blank">http://public.kitware.com/Bug/view.php?id=8189</a><br>
&gt;<br>
&gt; I think the main thing we want is a new target property named<br>
&gt; &quot;INCLUDE_DIRECTORIES&quot; - There&#39;s already a directory property with that<br>
&gt; name; the include_directories command is implemented in terms of that<br>
&gt; directory property. Along with that, we will also want<br>
&gt; per-configuration variants of the property, similar to the many<br>
&gt; existing target properties that have per-config variants.<br>
&gt;<br>
&gt; If you look at the code, you&#39;ll see that use of the existing<br>
&gt; INCLUDE_DIRECTORIES property triggers a call to<br>
&gt; cmMakefile::SetIncludeDirectories, which just saves it in a data<br>
&gt; member for later use. You can grep the code for GetIncludeDirectories<br>
&gt; for callers, or for just IncludeDirectories to see the direct usage in<br>
&gt; cmMakefile.cxx itself.<br>
&gt;<br>
&gt; The interesting bits here are going to be in deciding how to make<br>
&gt; these per-target include_directories behave. Should they be additive?<br>
&gt; 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>