A cross-platform cms write by C++