This is the c++ template system for writing advent of code tasks faster and with more convenience.
- Customizable template
- No configuration necessary
- shared submodules (you can add as many libraries as you want, as long as CMake supports them)
- Automatization scripts
- CMake version 3.16 or above
- C++ compiler (the configuration is set to c++17 in the CMakeLists.txt in template, however, you can change that)
- A way to run a shell script, if you don't have it, the simplest way is to get it is alongside with git, just make sure to select the option for installing "git bash"
- Clone the repository, make sure to do a recursive clone since it contains submodules
git clone --recurse-submodules "https://github.com/G-rox-y/AOC-CPP-Template" - Check out what is written in the template folder and modify it to your needs, since the default template setup is just how I use it
- When you want to solve a new task, run
create.shwith an additional argument that specifies the name of the new folder (ex:.\create.sh Day1) - The new folder will be created with 5 files,
input.txtwhere you are supposed to paste the input from the website,main.cppwhere you put your code,data.cppwhere you have premade function templates for reading the input, parsing it, and writing it tooutput.txt, andCMakeLists.txtwhich the scripts use to build your program - When you are done writing the code save it and run
run.shscript, it will compile your program and run it. If the command doesn't work, make sure to insert the folder name as an argument to the script (ex:.\run.sh Day1)
- The CMake script creates precompiled headers to speed up the compilation times, the precompiled header
pch.his inside the include folder - In the default template main.cpp includes data.cpp directly, they are separate files only for better readability
run.shknows what file to run thanks tolast.txtbecause that file saves what was the last folder thatcreate.shorrun.shwere using- You should run the scripts from their root folders since they arent made to be run from other locations
- The binaries will be built in the
buildfolder that will be created inside the project folder, they accessinput.txtandoutput.txtbecause the shell scripts run them inside those folders