<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 23, 2018 at 8:02 PM, Craig Scott <span dir="ltr"><<a href="mailto:craig.scott@crascit.com" target="_blank">craig.scott@crascit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Aug 23, 2018 at 4:40 AM, Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 08/21/2018 05:04 PM, Craig Scott wrote:<br>
> A user has recently been asking about reducing the output coming from a<br>
> FetchContent population when nothing needs to be done<br>
</span><span>> Because this is implemented as a sub-build, you always see the following<br>
> <br>
</span><span>> -- Configuring done<br>
> -- Generating done<br>
> -- Build files have been written to: ...<br>
<br>
</span>Isn't that output coming from the invocation here:<br>
<br>
  <a href="https://gitlab.kitware.com/cmake/cmake/blob/v3.12.1/Modules/FetchContent.cmake#L776-781" rel="noreferrer" target="_blank">https://gitlab.kitware.com/cma<wbr>ke/cmake/blob/v3.12.1/Modules/<wbr>FetchContent.cmake#L776-781</a><br>
<br>
rather than inside ExternalProject?<br></blockquote><div><br></div></span><div>Yes, that is where I'd like to be able to use the proposed --quiet or --silent option.</div><span class=""><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Why is that output not always captured?<span class="m_6905105382568897870HOEnZb"><font color="#888888"><br>
</font></span></blockquote></span></div><div class="gmail_extra"><br></div>If you capture it, then you don't get to see it until the command has completed. It can take non-trivial time and in some cases may require user input (e.g. to enter a password for a private SSH key). If you captured the output and the download hung for some reason, there would be no output to give any indication of where the download was up to. For cases where you don't expect problems, you can use the QUIET option and the output is indeed captured and only output at the end. This is the default because otherwise the output is rather noisy with all the ExternalProject step logging. But for cases where you need to investigate problems, you don't want the output captured.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Now that I've said all that, I guess FetchContent could check if the output of a QUIET run was just the above-mentioned three lines and drop them to leave no output in that case. Might be the simpler solution. Furthermore, for the second execute_process() call a few lines after the one referenced above (which does the build stage of the sub-build), we could potentially make use of the logging verbosity improvements in <a href="https://gitlab.kitware.com/cmake/cmake/merge_requests/2129" target="_blank">MR 2129</a> if/when it is done to further minimise the output of the "nothing to do" case.<span class=""><br><br></span></div></div></blockquote><div><br></div><div>Sorry, got my wires crossed a bit there. The QUIET option already fully absorbs the output unless there's an error. I missed this in the original issue that prompted this request. Let me go back to that issue and see if there's really anything needed here after all.</div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>New book released: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div>
</div></div>