[CMake] add_custom_command which generates new sources which I want to specify before

Baradé barade.barade at web.de
Thu Feb 28 18:13:41 EST 2013


Hi,
assuming I have the following statements:

add_library(targetName src1 src2 ... generatedSrc)
add_custom_command(TARGET targetName PRE_BUILD COMMAND bash -c "bla bla 
bla")

and the custom command generates sources which are specified before in 
"add_library" CMake/build process will abort since they don't exist 
already when specified (not needed actually).
Unfortunately, since it is an automated process I cannot easily get the 
names of the generated sources, they're just included in the usual 
sources variable (I can't separate them from the others).
Is there any possibility to get this working without knowing the source 
file names?

regards


More information about the CMake mailing list