Revert CMake-magic to upstream