Don't overwrite the header file for in-source builds.
Merge topic 'fix-OLD-CMP0021' into next

d0d45ee Don't overwrite the header file for in-source builds.