Completely hiding output from ExternalProject_Add

As part of my build, I’m building libbacktrace from source, using ExternalProject_Add:

ExternalProject_Add(libbacktrace-git-repo
    GIT_REPOSITORY https://github.com/ianlancetaylor/libbacktrace.git
    GIT_TAG 4f57c999716847e45505b3df170150876b545088
    SOURCE_DIR  git/libbacktrace
    BINARY_DIR  git/libbacktrace-build
    INSTALL_DIR git/libbacktrace-install
    GIT_CONFIG advice.detachedHead=false
    CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/git/libbacktrace/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/git/libbacktrace-install
    BUILD_COMMAND make
    INSTALL_COMMAND make install
    BUILD_BYPRODUCTS git/libbacktrace-install/lib/libbacktrace.a
    )

This works fine, except that it dumps A LOT of output during the configuration and build phases, all of which is irrelevant to me and I’d like to get rid of.

If I add these parameters to ExternalProject_Add:

    LOG_CONFIGURE ON
    LOG_INSTALL ON
    LOG_BUILD ON
    LOG_OUTPUT_ON_FAILURE ON

The result is greatly improved, in that now I just get:

[40/44] Performing configure step for 'libbacktrace-git-repo'
-- libbacktrace-git-repo configure command succeeded.  See also /home/brevzin/repo/build/libs/backtrace/libbacktrace-git-repo-prefix/src/libbacktrace-git-repo-stamp/libbacktrace-git-repo-configure-*.log
[41/44] Performing build step for 'libbacktrace-git-repo'
-- libbacktrace-git-repo build command succeeded.  See also /home/brevzin/repo/build/libs/backtrace/libbacktrace-git-repo-prefix/src/libbacktrace-git-repo-stamp/libbacktrace-git-repo-build-*.log
[42/44] Performing install step for 'libbacktrace-git-repo'
-- libbacktrace-git-repo install command succeeded.  See also /home/brevzin/repo/build/libs/backtrace/libbacktrace-git-repo-prefix/src/libbacktrace-git-repo-stamp/libbacktrace-git-repo-install-*.log

That’s… substantively better. But really I would like zero output.

I tried changing BUILD_COMMAND make to BUILD_COMMAND make 2>&1 >/dev/null but that appears to escape the >/dev/null part, so that it tries to execute make 2>&1 ">/dev/null" instead.

Is there a way to completely squash this output?

3.20 suppresses this message for the Ninja generator. @craig.scott had a refactoring that passed around a QUIET argument to also suppress it, but it had to be reverted.

I had hoped to get most of that reverted work back in for 3.21, but I’m not going to have time. I’ll hopefully get a chance to put it in for 3.22 later in the year.