Programming: Principles and Practice Using C++ - Exercises... and more.
In the root directory of the project:
-
add common repository as a git remote:
git remote add upstream https://github.com/NadzwyczajnaGrupaRobocza/papuc_exercises.git
-
pull common repository changes to local cache
git fetch upstream
-
make sure you're at your main brach
git checkout master
-
merge upstream changes to your checkout
git pull --rebase upstream master
Only step 4 is needed to later repeat the procedure
In the root directory of the project:
-
Make git aware of the fact we have submodule
git submodule init
-
Actually pull the submodules
git submodule update
You're now ready to compile stuff.
In the root directory of the project do the following:
-
create build directory and enter it
mkdir build; cd build
-
run cmake and point it ot the root dir
cmake ..
-
run make (point it to the desired target binary) e.g.
make <target-name>
Note that target name is the same as first argument given to cmake add_executable function.
-
Move your files to your user directory (<project-root>/<user-prefix>/...)
-
Edit the CMakeLists.txt file in your user directory.
- In "add_executable" command, replace empty.cpp with the name of your source file.
- You can add more source files to the add_executable command - it takes in a space separated list of files of any length.
-
Follow the build instructions to let the cmake magic happen.