Hi guys, I'm introducing myself to classes in c++. Here in this example, I 've created a class "particle" ( which contains as protected data members the mass and the charge of a particle ) and several derived classes of known particle ( electron.h, proton.h, ecc. ), after that I put all this known particles in a proper directory.
How can I include the path of that directory in the Makefile instead of including it in the main.cxx?
Thanks in advance for the help.
I leave here my current code.
main.cxx :
1 2 3 4 5 6 7 8 9
#include "particle.h"
#include "./known_part/electron.h"
#include<iostream>
int main () {
...
return 0;
}
The CMake writes a Makefile for you and supports out of source builds.
In other words, you compile is different directory than where your source code is.
That makes cleaning easier; you can simply remove the build directory.