For every configure_file inside a CMakeLists.txt, abort the build if the result file is being created in a builddir != srcdir, and if the file configure_file generates is already present in srcdir.
This should prevent future occurrences of avrdudes#1706.
Note that it is not just bootstrap/autoreconf autotools buildsystem installations which leave a src/ac_cfg.h file lying around. cmake . also does that.