[PTFM-8566] Fix versioning and code duplication in CMakeFiles