ISPC Language support

I now have a decent function that compiles things correctly but I wanted to support CMAKE_ISPC_FLAGS_ to some extent. I’d need to be able to choose the right variable at generation time.

I however didn’t find a good way to do it using genexpressions. (since variables would be expanded at configuration time).
The “trick” I thought about was to use file properties but gen expressions can only retrieve target properties. I could put the properties in the target but there might be a better way?

To be clear I’m trying to do the equivalent of ${CMAKE_ISPC_FLAGS_$<CONFIG>} in my add_custom_command COMMAND