If you want to investigate cmake further, the official tutorial is available here: Further learninghttps://cmake.org/cmake-tutorial/ However there are a large number of more beginner friendly blogs and videos available online that you might find a better option.
CMake is not the only automated tool that you can use to make your life easier. Doxygen for example (https://caiorss.github.io/C-Cpp-Notes/Doxygen-documentation.html) can be used to automatically convert docstrings and comments in your code into documentation in multiple formats (html, pdf). At the very least, writing your docstrings in doxygen format ensures that they will be clear and understandable even if you don't generate a documentation document from it.