how to cleanup random byproducts

Yes, this makes sense. The globbing is done at CMake configure time. If that changes, the glob is likely to be inaccurate in the future (e.g., a new .bar file is made during the build by some other process.