Add cmake code to create library for c++