-
Notifications
You must be signed in to change notification settings - Fork 1
CMake
CMake is cross-platform free and open-source software for managing the build process of software using a compiler-independent method. It is designed to support directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as make, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.
CMake will require the following software
cd ~/Software
curl -SL http://www.cmake.org/files/v3.1/cmake-3.1.1.tar.gz | tar xzv
cd cmake-3.1.1/
./configure && make && sudo make install && sudo ldconfig
..
Building software with CMake kinda has a different set of instructions that building software with Make.
Make is pretty much your standard software for building software, and the instructions of using it generally look like this.
./configure && make && sudo make install && sudo ldconfig
What happens here
-
./configurerun a script that executes configuration. Some software projects don't have this. - 'make
which is the command that tells the software to look for a __makefile__ in the current diretory and use it to build software. This file contains a list ofgccand/org++` commands for the most part. A makefile allows for the person who downloads the software to automate this process rather than compile each file individually, much like a shell script. -
sudo make installis often the third and final step of the./configure && make && sudo make installtrio. It executes theinstallcommand that may be in the make file to move the software that we built into some place like/usr/local. Because that directory is outside of the home directory, root access is required, hence thesudocommand. -
sudo ldconfigisn't really required, per-se, but I just add it so theld.so.conffile checks and updates any libraries and headers it may encounter.
TODO: Do I really need to do that forth step?
CMake projects are constructed a bit differently. Generally you have to creat the build/ directory, go to it, and then run a cmake command to execute the makefile in the parent directory like so.
mkdir build && cd build
cmake .. && make && sudo make install && sudo ldconfig
Basically, cmake replaces the need to create a configure script by making one.