This sounds like an Eclipse issue to me. The non-IDE (VS and Xcode) generators expect the compiler to be available in the environment. You might need to either tell Eclipse about how to provide such an environment to CMake when it runs it or run Eclipse from within a MinGW-aware environment.
Setting the compiler like that is not supported at all in any case. You need to do it via -D
on the command line or via a toolchain file if CMake’s not going to find it with its default search procedure.