Define a pre-build command without creating a new target

The problem was explained in the issue:
https://gitlab.kitware.com/cmake/cmake/-/issues/21061

It currently can’t be done, a custom target must be used