Fix cmake build on windows & travis build.