Note that the ones listed on Google Code doesn't have anything to do with Google itself and they are outdated! The project has since moved over the Sourceforge:
http://sourceforge.net/projects/mingwbuilds/If it finds the wrong toolchain then it's no wonder when things go wrong.
Make sure your PATH only contains the path to the mingw builds compiler, you might have to relog to make sure the change takes full affect on the system, if you run cmake from a command line, make sure to restart the command line.
Next you need to delete the CMake cache. I always run CMake from a separate build directory, so if I need to rest CMake I can just delete that build directory, without having CMake spam your source directory.
That way it should work flawlessly.
For my setup with around 10 different compilers, I never have any set in PATH, but whenever I open a new command line for compiling I quickly set the environment variable:
set PATH=C:\Dev\MinGW32-XYZ\bin;%PATH%Then I run cmake-gui and make sure to let it generate its files in patch-to-source/build. Don't forget to set a valid install directory!
After generating is done you switch to the build directory and run mingw32-make install -j4