<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
William A. Hoffman wrote:
<blockquote
 cite="mid6.2.0.14.2.20060717081646.08787760@pop.nycap.rr.com"
 type="cite">
  <pre wrap="">At 12:26 AM 7/17/2006, Brandon J. Van Every wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Because last I tried, it was broken.  Precise definition of "broken" later.  I'm in the middle of a huge refactoring right now, driven by these pathing and quoting and escaped whitespace problems. 
    </pre>
  </blockquote>
  <pre wrap=""><!---->If it is broken, please let me know so it won't be broken in the next patch release
of CMake when it comes out.
  </pre>
</blockquote>
<br>
Ok, FILE(TO_NATIVE_PATH ...) is "broken" on Windows in that it doesn't
enclose the resultant path in double quotes.&nbsp; This is a debateable
aspect of design.&nbsp; Quotes get in the way of merging paths, but they are
also necessary to make a path usable.&nbsp; <br>
<br>
<br>
MACRO(MAKE_WINDOWS_PATH pathname)<br>
&nbsp; # An extra \\ escape is necessary to get a \ through CMake's
processing.<br>
&nbsp; STRING(REPLACE "/" "\\" ${pathname} "${${pathname}}")<br>
&nbsp; # Enclose with UNESCAPED quotes.&nbsp; This means we need to escape our<br>
&nbsp; # quotes once here, i.e. with \"<br>
&nbsp; SET(${pathname} \"${${pathname}}\")<br>
ENDMACRO(MAKE_WINDOWS_PATH)<br>
<br>
SET(CMAKEISH_PATH "C:/Program Files/Chicken")<br>
MESSAGE(${CMAKEISH_PATH})<br>
<br>
SET(MY_NATIVE_PATH ${CMAKEISH_PATH})<br>
MAKE_WINDOWS_PATH(MY_NATIVE_PATH)<br>
MESSAGE(${MY_NATIVE_PATH})<br>
<br>
SET(YOUR_NATIVE_PATH ${CMAKEISH_PATH})<br>
FILE(TO_NATIVE_PATH ${CMAKEISH_PATH} YOUR_NATIVE_PATH)<br>
MESSAGE(${YOUR_NATIVE_PATH})<br>
<br>
MACRO(SEPARATION_TEST path)<br>
&nbsp; SET(SEPARATED_HOOEY ${${path}})<br>
&nbsp; SEPARATE_ARGUMENTS(SEPARATED_HOOEY)<br>
&nbsp; MESSAGE("${SEPARATED_HOOEY}")<br>
ENDMACRO(SEPARATION_TEST)<br>
<br>
SEPARATION_TEST(CMAKEISH_PATH)<br>
SEPARATION_TEST(MY_NATIVE_PATH)<br>
SEPARATION_TEST(YOUR_NATIVE_PATH)<br>
<br>
<br>
Brandon J. Van Every@KAHLO ~<br>
$ cmake -P windowspath.cmake<br>
C:/Program Files/Chicken<br>
"C:\Program Files\Chicken"<br>
C:\Program Files\Chicken<br>
C:/Program;Files/Chicken<br>
"C:\Program;Files\Chicken"<br>
C:\Program;Files\Chicken<br>
<br>
<br>
</body>
</html>