revert r8691 (fixes issue 2629)
gen-cmakefiles.py is mostly working