More work on cmake port for mingw.