Don't assume that all generators have an 'all' target.

The better alternative is to just treat the all target as
special and not specify a --target to cmake --build. Just don't
specify anything and do what the buildsystem does by default