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.
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.
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?
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.
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.