[CMake] Custom object files for intermediate build products

Tom Birch tbirch at apple.com
Thu Jun 24 02:29:16 EDT 2010


Hi,

I'm trying to invoke the C compiler in cmake as would happen with an add_excecutable command, but I don't want to generate an object file. Basically I have a script which generates a c file, I want to compile that file in the environment I've set up, while passing the -S flag. I then want to run that .s file through another script to generate a header which will then be a dependency of my main executable. Doing the scripts is easy with add_custom_target, and I'm sure I could write all the magic to generate the full compile command line myself, but isn't there some elegant way to generate the a single compiler invocation that doesn't result in a dylib or a binary, that works in a similar way to add_excecutable?

cheers,
Tom


More information about the CMake mailing list