[CMake] Native Pathsupport under Windows

Brandon Van Every bvanevery at gmail.com
Tue Oct 23 21:04:34 EDT 2007


On 10/23/07, alexander at camek.de <alexander at camek.de> wrote:
> Hi,
>
> >> I need to use under windows the buildin commands of the shell. But
> >> when I run these commands they doesn't work correctly, because the
> >> windows commands doen't like the slashes (/). It seems to me that
> >> they want to get backslashes (\).
>
> >> 1. Is there a possiblity to get backslashes instead of slashes as
> >> paths?
>
> > FILE(TO_NATIVE_PATH ...)
>
> When I do a FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} RESULT)
> and then use ${RESULT} I get the whole again with slashes.

You have found a bug, which I have filed as
http://cmake.org/Bug/view.php?id=5939

FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} native_srcdir)
MESSAGE("${native_srcdir}")

under a "MinGW Makefiles" generator produces
"C:/devel/src/bugs/native".  This is wrong.  A "Visual Studio 8 2005"
generator produces "C:\devel\src\bugs\native", the correct result.


Cheers,
Brandon Van Every


More information about the CMake mailing list