Make the cmake build cross-platform compatible.