CMake does not find PETSc

@HDY Thank you very much!
I had a look at the attached logs and I am really puzzled as the test code used by FindPETSc compiles and links to the expected libraries but fails to run.

Can you try to compile, link and run the example manually?
The exact commands are listed at the very bottom of the CMakeError.log.

static const char help[] = "PETSc test program.";
#include <petscts.h>
int main(int argc,char *argv[]) {
  PetscErrorCode ierr;
  TS ts; 
  ierr = PetscInitialize(&argc,&argv,0,help);CHKERRQ(ierr); 
  ierr = TSCreate(PETSC_COMM_WORLD,&ts);CHKERRQ(ierr); 
  ierr = TSSetFromOptions(ts);CHKERRQ(ierr); 
  ierr = TSDestroy(&ts);CHKERRQ(ierr); 
  ierr = PetscFinalize();CHKERRQ(ierr); 
  return 0;
}