What is the point of cmake command line
I am trying to build software by following some instructions in line.
cd app
mkdir -p build/Release
cd build/Release
cmake ../..
make installpyplusplus && cmake .
make .
My questions:
- What does "../ .." after
cmake
mean or mean? - What is the meaning of the point after
make
? - what installpyplusplus && cmake will do. '?
source to share
The application cmake
looks for a single file in a special format called CMakeLists.txt
. So by running:
cmake ../..
I like to say cmake
that CMakeLists.txt
- these are the two directories below, as described in MERose.
The command cmake
creates many files in your current working directory (CWD, the directory where you ran the command) and among them there is a file named Makefile
that has rules about what files to compile / copy / write / whatever and how to do it.
So when you run:
make .
You tell the application make
that the file Makefile
is on your CWD. It also works:
make
This looks for a file Makefile
on your CWD.
Conclusion, .
this is CWD, but ..
one level below.
EX: If your CWD /Users/yourname/
-
.
represents/Users/yourname/
-
..
represents/Users/
-
../.
represents/Users/
-
../..
represents/
Etc...
what installpyplusplus && & cmake will do. '
When you use &&
, the commands will be executed sequentially if the first command returns true (null status completion). So, in the case that you said make installpyplusplus
will be launched, and after executing it (it can create CMakeLists.txt
, I don't know what you are using), if it returns true, the command cmake .
will be and if CMakeLists.txt
there is, it will work correctly.
BONUS:
If you run:
make -j4
You will split the build process in 4 instances (you can change 4 to whatever you want)! The multi-threaded magic will make it build faster if you have more than one CPU core :)
source to share