Rework CMake to the library's form.
Fix CMake.