Why do we use CMAKE for libraries?

Hello all. Looking to understand something from the c++ community. I have been told to use CMake to build or compile a library.

Why do we need to build libraries after we download it? And how does it work?

From what I have found so far.... CMAKE is a took that takes a pre-made list.txt file with all the compiling instructions written out by the library developers and "makes" it.

This library is then sent to some file that you have to make your compiler to search for when including that library in a project.

Is any of this wrong? Can anyone elaborate? Thank you.

Thanks.
The point of CMake is that writing make scripts (make is a standard utility to build programs) in a cross-platform manner is very difficult. CMake attempts to solve this by automating several tasks of the script generation, such as checking for availability of certain libraries, etc.
How does it correlate to downloading and linking external libraries I may need to use for an application or program i'd like to develop?
You need a make script (or equivalent) to be able to build the library, and you need to build the library to be able to link to it.
aren't libraries already built when you download them from a developrs site? Say sfml or similar external library?
The developers might provide prebuilt binaries for your particular platform, or they might not. Most don't.
And when hey don't there is just the source code and we have to compile so that the source code of the library is translated into binary to be used in future projects by the IDE?

How can I compile these source codes with an IDE?
And when hey don't there is just the source code and we have to compile
Right.

How can I compile these source codes with an IDE?
It may or may not be possible to build a particular source with just an IDE. Unless you're trying to achieve something very specific (e.g. forcing a library to link statically), it'll usually be more effort than the build system the developer prepared.
You generally build libraries with the tools provided then use the built libraries how you want (e.g. using an IDE)
Ah I see now. So if there is no binary there than we have to compile it ourselves to create the binary. And then we can link the libraries to our projects in our IDEs to use their functions.

Thanks.
Topic archived. No new replies allowed.