Pass verbosity to custom/external commands? (ideally at build-time)

With ExternalProject_Add/add_custom_command/etc, what’s the best way to pass verbosity through as extra arguments?

Ideally increasing build-time verbosity via make VERBOSE=1 or similar can also call some command --verbose do (while regular make calls some command do)… but $<VERBOSE> isn’t a valid generator expression.

Simplistically, a one-liner like:

ExternalProject_Add(foo
  ...
  BUILD_COMMAND some command $<$<BOOL:VERBOSE>:--verbose> do
  ...
)

$<$<BOOL:${VERBOSE}>:--verbose> works (configure-time), except that when it’s not set you end up with "" as an argument, which causes argument-parsing issues for the inner command.

How are others solving this cleanly? I know I can append to an arglist but it quickly gets unwieldy with many commands:

set(myBuildCommand some command)
if(VERBOSE)
  list(APPEND myBuildCommand --verbose)
endif()
list(APPEND myBuildCommand do)
ExternalProject_Add(foo
  ...
  BUILD_COMMAND ${myBuildCommand}
  ...
)

There’s no mechanism for this. Other build tools have no way to know that verbosity is asked for and CMake doesn’t offer a way to use build-time make variables.