[jenkins] - refactor jenkins scripts to centralise the decision for
rebuilding depends - add project/cmake dir as criterion
Merge pull request #5770 from Memphiz/cmakejenkins

[jenkins] - refactor jenkins scripts to centralise the decision for