[CMake] Adding required source files to a custom target

Attila Krasznahorkay attila.krasznahorkay at gmail.com
Thu Dec 3 09:47:38 EST 2015


Dear All,

Is it possible to add additional source files to an already existing custom target?

My project needs to generate a number of "different things", which it does by setting up many custom commands. In order to trigger the generation of everything, I currently need to set up an inconvenient number of custom targets as well. Would it be possible to attach multiple custom commands to an already existing custom target?

Unfortunately it's not really an option to only set up the custom target once all the custom commands are already configured, and all their outputs are already known.

I guess my question is, what property of a custom target I need to append file names to? What internal property gets set with the values passed to the SOURCES argument of add_custom_target? (That I could then append additional file names to.)

Cheers,
           Attila


More information about the CMake mailing list