Update CMakeLists to build a library