Skip to content

Instantly share code, notes, and snippets.

@HendrixString
Last active November 23, 2018 22:46
Show Gist options
  • Save HendrixString/0ee7ab5f05cfcd6d54f8656532ad0ddc to your computer and use it in GitHub Desktop.
Save HendrixString/0ee7ab5f05cfcd6d54f8656532ad0ddc to your computer and use it in GitHub Desktop.
cmake knowledge

creating cmake config files

  • cmake -H. -Bbuild - will creates CMake configuration files inside folder build. -H. refers to source directory where cmakelists.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

some discussions:

g++ crash course

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment