2009/5/10 Eric Noulard <eric.noul...@gmail.com>:
> 2009/5/10 Tanguy Krotoff <tkrot...@gmail.com>:
>> Hello
>>
>> I'm pulling my hair out on what should be straightforward.
>>
>>        file(TO_NATIVE_PATH ${file} file_native)
>>        execute_process(
>>                COMMAND type \"${file_native}\"
>>                RESULT_VARIABLE result
>>                OUTPUT_VARIABLE output
>>                ERROR_VARIABLE error
>>        )
>>        message("result=${result}")
>>        message("output=${output}")
>>        message("error=${error}")
>>
>> I'm running this under Windows and it gave me this output:
>>
>> result=0
>> output=
>> error="C:\Documents and
>> Settings\tanguy_k\Desktop\phonon-vlc-mplayer\trunk\AUTHORS" not found
>>
>> Of course the file exist and if i enter
>>        type "C:\Documents and
>> Settings\tanguy_k\Desktop\phonon-vlc-mplayer\trunk\AUTHORS"
>> inside a DOS command prompt everything works fine.
>>
>> It's like CMake does something to the filename that I don't understand
>
> I do have weird behavior on Unix too,
> with filename with embbeded "space" in them.
>
> It looks like I must NOT TO_NATIVE_PATH for make it work?
>
> My unix example is attached.
> try:
> cmake -P buggy_execute.cmake
>
>> Any idea why?
>
> Nope.
> Looks like there is trouble with escaped character.

On linux with CMake 2.6.4, execute_process seems to automatically escape
character... (at least space or '\')

strace-ing my previous example gives:

execve("/usr/local/bin/dir", ["dir", "/home/eric/with\\ space\\ in\\
it.txt ....)



-- 
Erk
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to