cmake -H. -Bbuild
- will creates CMake configuration files inside folder build.-H.
refers to source directory wherecmakelists.txt
is at.-Bbuild
is th folder to where to put all of the generated cmake config.cmake --build build -- -j3
- will generate the output program
- add c++ files recursively - https://stackoverflow.com/questions/27992346/how-to-use-cmake-glob-recurse-for-only-some-subdirectories
- very good guide - http://derekmolloy.ie/hello-world-introductions-to-cmake/
- also good - https://medium.com/@onur.dundar1/cmake-tutorial-585dd180109b
To specify a directory to search for (binary) libraries, you just use -L:
-L/data[...]/lib
To specify the actual library name, you use -l:
-lfoo # (links libfoo.a or libfoo.so)
To specify a directory to search for include files (different from libraries!) you use -I:
-I/data[...]/lib
So I think what you want is something like
g++ -g -Wall -I/data[...]/lib testing.cpp fileparameters.cpp main.cpp -o test