[CMake] escaping spaces in paths with cmake -E commands?
Zachary Pincus
zpincus at stanford.edu
Mon May 8 12:47:10 EDT 2006
>> Now, when I had set this all up in the context of an
>> ADD_CUSTOM_COMMAND instead of an EXEC_PROGRAM, things seemed to
>> work -- is there automatic path escaping for args to custom
>> commands, but not exec'd programs, in this version of CMake? (For
>> some reason, we had to move to EXEC_PROGRAM instead of using a
>> custom command...)
>
> The EXECUTE_PROCESS command in CMake 2.4 fixes this and handles
> argument escaping automatically just like custom commands.
Brad,
Thanks for your help. I'm glad to hear about EXECUTE_PROCESS.
Unfortunately, I think for the time being, I'm stuck with the CMake
version required by ITK... There's no chance that ITK will require
2.4 soon, is there?
Assuming I'm stuck with 2.2.3, what's my best bet: use a
CUSTOM_COMMAND, or do you think that the following usage is portable:
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different "'${src}'" "'$
{tgt}'")
or maybe
EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different "\"${src}\""
"\"${tgt}\"")
Thanks,
Zach
More information about the CMake
mailing list