VS,Xcode: Fix TARGET_PROPERTY genex in source COMPILE_FLAGS property

This already worked in other generators.  Also add a test case.

Fixes: #17314
18 jobs for src-flags-genex-target
Status Job ID Name Coverage
  External
passed cdash

passed cmake-terfin-windows-debug-vs2017

passed ghostflow-branch-check-master

passed ghostflow-commit-check

passed ghostflow-stager

failed cmake-terfin-windows-debug-vs2017

failed cmake-terfin-windows-debug-vs2017

00:58:26

failed cmake-terfin-windows-debug-vs2017

failed cmake-terfin-windows-debug-vs2017

00:58:18

passed cmake-terfin-windows-debug-vs2017

00:37:45

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager

passed ghostflow-stager