Updated cmake-based buildsys to make it work with Windows.