<div dir="ltr">Alan,<div><br></div><div>Thanks for your help! I tried to implement that paradigm myself in a small example CMakeLists.txt which I've attached, but the addition of a depending custom target doesn't seem to change the context of the 'this' target. In other words, the IS_INTERROGATE property is still read from fake_target and not depending_target.</div><div><br></div><div>Could you take a look and clarify what I'm not doing quite right?</div><div><br></div><div>Best,</div><div>Sam</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 18, 2018 at 3:09 PM, Alan W. Irwin <span dir="ltr"><<a href="mailto:irwin@beluga.phys.uvic.ca" target="_blank">irwin@beluga.phys.uvic.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2018-02-18 03:49-0700 Sam Edwards wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
However, when it came time to actually set this IS_INTERROGATE property, I<br>
could find no way to apply it to a custom command. I guess this makes sense<br>
- custom commands aren't targets, after all. But I couldn't convert my<br>
custom command to a custom target, because it produces a C++ source file<br>
and I need to use OUTPUT to let CMake know where that source file comes<br>
from, and you can't use OUTPUT and TARGET together in add_custom_command.<br>
</blockquote>
<br></span>
Hi Sam:<br>
<br>
It's quite common for each custom command to have a corresponding<br>
custom target that DEPENDS on the OUTPUT of the custom command.  So<br>
building the target part of that pair means the custom command is<br>
executed *only if* the OUTPUT from it is out of date.<br>
<br>
If you used that paradigm for the custom commands you refer to<br>
above (where each such custom command is paired with a unique target<br>
via the DEPENDS of the latter) could you not set the IS_INTERROGATE<br>
property for the custom target part of of each pair whenever that<br>
property is relevant?<br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" rel="noreferrer" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state<br>
implementation for stellar interiors (<a href="http://freeeos.sf.net" rel="noreferrer" target="_blank">freeeos.sf.net</a>); the Time<br>
Ephemerides project (<a href="http://timeephem.sf.net" rel="noreferrer" target="_blank">timeephem.sf.net</a>); PLplot scientific plotting<br>
software package (<a href="http://plplot.sf.net" rel="noreferrer" target="_blank">plplot.sf.net</a>); the libLASi project<br>
(<a href="http://unifont.org/lasi" rel="noreferrer" target="_blank">unifont.org/lasi</a>); the Loads of Linux Links project (<a href="http://loll.sf.net" rel="noreferrer" target="_blank">loll.sf.net</a>);<br>
and the Linux Brochure Project (<a href="http://lbproject.sf.net" rel="noreferrer" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
</blockquote></div><br></div>