Add cmake function to configure pre-commit hooks
By calling this function a pre-commit hook will be automatically created. In case the user tries to commit unformatted changes an error will be displayed.
This is based on @aacid's work on okular, which is why he got full credit for the script :)
We discussed the clang-format topic on the #plasma meeting and a pre-commit hook was seen as good way to enforce the formatting, because gitlab-ci integration is still experimental. Any by having this automatically added we can be sure that contributors do not overlook the section in the README about formatting.
Edited by Alexander Lohnau