cleanup CMake files, add Windows compilation workaround