ExternalProject BUILD_BYPRODUCTS generator expression

Can ExternalProject BUILD_BYPRODUCTS use generator expressions? It seems maybe not as I get errors about “<” and “>” not being allowed. This is to account for a library that may be built by the externalproject, or not built if it’s found via find_package.

I have been able to implement needed functionality by if() and list(APPEND …) instead with an auxiliary variable.

add_custom_command(BYPRODUCTS) supports a limited set of genexes starting in 3.20:

  .. versionadded:: 3.20
    Arguments to ``BYPRODUCTS`` may use a restricted set of
    ``generator expressions``.
    :ref:`Target-dependent expressions <Target-Dependent Queries>` are not