[jenkins] - refactor jenkins scripts to centralise the decision for
rebuilding depends - add project/cmake dir as criterion