cmake: Friendlier message when trying to --build the wrong dir

Also for --open.

Fixes: #11166
3 files changed