[cmake-developers] A CMAKE_EMULATOR variable

Matt McCormick matt.mccormick at kitware.com
Tue Apr 7 08:57:46 EDT 2015


On Mon, Apr 6, 2015 at 10:24 AM, Brad King <brad.king at kitware.com> wrote:
> On 04/05/2015 11:07 PM, Matt McCormick wrote:
>>> In each place that you ExpandListArgument to get the emulator
>>> command and arguments and write them out before an executable
>>> name, you need to be sure to make the proper call to escape
>>> each argument.  In each case the code just below your hunk
>>> does this for the test arguments.
>>
>> Good catch.  Fixed.
>
> Thanks.  In try_run:
>
>> +    finalCommand += " ";
>> +    for (std::vector<std::string>::const_iterator ei =
>> +         emulatorWithArgs.begin()+1;
>> +         ei != emulatorWithArgs.end(); ++ei)
>> +      {
>> +      finalCommand += *ei;
>> +      finalCommand += " ";
>> +      }
>
> This still doesn't quote the arguments to the emulator.
> It needs to be quoted enough to get through the command line
> parsing that try_run does later.  Or, things need to be
> refactored to avoid extra quoting/parsing steps.

Missed that one. Quotes have been added.

>>> The Tests/RunCMake/pseudo_emulator.cxx tool must be able to
>>> compile with any of the compilers we test, not just those that
>>> host the build of CMake.  It will be more portable to use a
>>> .c file with <stdio.h> and printf.
>
> The pseudo_emulator still needs to be converted to C, please.

Done.

Thanks for the reviews. Merged to next.

Thanks,
Matt


More information about the cmake-developers mailing list