Fix out-of-tree build when using CMake. The entire source tree now remains untouched.