cmake: only set the export if not defined

2 jobs for qttesting-new-cmake
latest