[CMake] Re: Ignoring command return code in add_custom_command

Rodolfo Schulz de Lima rodolfo at rodsoft.org
Fri Dec 14 10:55:41 EST 2007


Bill Hoffman escreveu:
> Rodolfo Schulz de Lima wrote:
> 
>>
>> function call_command()
>> {
>>     -- I think that passing 'COMMAND' is not needed, but it's ok if
>>     -- one cares about maintaining the cmake script syntax.
>>     ret = execute_process(COMMAND, "whatever");
>>     -- do something with ret
>>     return true; -- or false, to make the build stop
>> }
>>
>> add_custom_command(OUTPUT, "text.cpp" COMMAND call_command);

> So, how would the above work?  The custom command would have to run 
> call_command at build time.  That means Xcode, VS, and make would all 
> have to run call_command.  I would think that would have to be done by 
> running a script.  Unless you want to translate the lua function into 
> make, Xcode, VS, etc.  Again, I think this is more of a feature request, 
> that moving to lua would have no impact on.  You want to put cmake/lua 
> code into a custom command and have it run during the build.

No, I said that add_custom_command should run 'call_command' in project 
creation time, not in build time. This way it would execute 
'execute_process', which would generate the required call according to 
the generator used.

Regards,
rod



More information about the CMake mailing list