Programming: Principles and Practice Using C++ - Exercises
User prefix will be written as . User prefix can be one of "lm", "ib", "mb".
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 merge upstream/master
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 ch04-<user-prefix>
-
The resulting binary is at /build/ch04/lm/ch04-lm
-
Move your files to your user directory (/ch04/)
-
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.