cmake: only set the export if not defined

2 jobs for qttesting-new-cmake
latest
Status Job ID Name Coverage
  External
passed ghostflow-branch-check-master

passed ghostflow-commit-check