[CMake] Re: Ignoring command return code in add_custom_command

Alexander Neundorf a.neundorf-work at gmx.net
Fri Dec 14 20:46:42 EST 2007


On Friday 14 December 2007, Bill Hoffman wrote:
> Rodolfo Schulz de Lima wrote:
> > I see... after some thought I understood that the user would
> > (rightfully) expect that call_command would be executed in build time.
> > What if it he executes something that the generator cannot handle (open
> > a socket and send the return value, for example)? This cannot be done,
> > and indeed has nothing to do with lua vs. cmake.
>
> That said, an automatic way of running a cmake script at build time as
> part of a custom_command might be a good feature.
>
> Something like this:
>
> set(SCRIPT "
> execute_process(COMMAND whatever)
> ")
> add_custom_command(OUTPUT text.cpp COMMAND_SCRIPT ${SCRIPT})

See bug report #3604 :-)

Alex


More information about the CMake mailing list