So I want to add logging to my c++ project, and people say spdlog is good. I think spdlog has very clear installation instructions here: https://github.com/gabime/spdlog/tree/v1.x Clone the repo, create build folder and run cmake. And then an example of a cmakeFile. But I dont know cmake, and I know to little about libraries.
Cmake to my understanding is a file where you can specify everything needed to build a project. But it seems my IDE (currently codeBlocks for windows) does all that for me, so I have never learnt Cmake.
Libraries to my understanding is prebuilt classes/functions that I can include in my project.
I already use SDL in my project. To get that one to work I think I just ran some install program that created the library files like this

and then I have added include path in
Codeblocks->project->build options->Search directories->compiler
and lib path in
Codeblocks->project->build options->Search directories->linker
and some settings in
Codeblocks->project->build options->Linker settings->other linker options
And then I can Include headers and use functions and classes.
What confuses me about the spdlog cmake file example (and the cmake in this question) is that they references external files (example.cpp and drumhero.h). Shouldent it just specify the spdlog files, and an output directory where the created library files will be put? Why does the library cmake need to know about my project files? It should just create a library usuable by any project, not just mine.
I feel like I have fundamentally missunderstod something. Can someone point me in the right direction?