find_(program,library,file,path): add validation function

Fixes: #23603
59 files changed