build-style/cmake.sh: add generic do_check function.
build-style/cmake.sh: add generic do_check function.

Closes #9391.

necrophcodr/void-packages,coredumb/void-packages,EaterOfCode/void-packages,NeoChontrix/void-packages,floGik/void-packages,necrophcodr/void-packages,EaterOfCode/void-packages,NeoChontrix/void-packages,kulinacs/void-packages,NeoChontrix/void-packages,NeoChontrix/void-packages,juliendehos/void-packages,EaterOfCode/void-packages,juliendehos/void-packages,juliendehos/void-packages,coredumb/void-packages,NeoChontrix/void-packages,kulinacs/void-packages,coredumb/void-packages,necrophcodr/void-packages,juliendehos/void-packages,coredumb/void-packages,floGik/void-packages,kulinacs/void-packages,kulinacs/void-packages,necrophcodr/void-packages,floGik/void-packages,NeoChontrix/void-packages,coredumb/void-packages,floGik/void-packages,juliendehos/void-packages,coredumb/void-packages,EaterOfCode/void-packages,EaterOfCode/void-packages,floGik/void-packages,necrophcodr/void-packages,floGik/void-packages,kulinacs/void-packages,kulinacs/void-packages,juliendehos/void-packages