`add_custom_command` and Generated Header Dependencies

Solution:

Following this post with the new File sets: How to install an interface library with generated source in build folder - #2 by ben.boeckel

I was able to get around this by creating an interface library with a generated name “${target}_gen_lib”, and then put the generated files into the fileset of the interface library.

adding target_link_libraries(${target} ${target}_gen_lib) then allows everything to work, since the gen_lib target must be completed before ${target} is run.