Fixes in CMake for building snapshots