I don't see a way to join or normalize paths in CMake. For example, there is a "base path" that the user can specify in a cache variable, like so:<div><br></div><div>BASE_PATH = "T:/stuff/"</div><div>
<br></div><div>Later in my CMake script, I join a subpath to it like so:</div><div><br></div><div>"${BASE_PATH}/morestuff"</div><div><br></div><div>The problem is, this becomes:</div><div><br></div><div>"T:/stuff//morestuff"</div>
<div><br></div><div>Notice the double slash. Also if the user specifies backslashes in the variable, you get this:</div><div><br></div><div>"T:\stuff\/morestuff"</div><div><br></div><div>Normalization would be ideal here, or a way to properly join the paths like so:</div>
<div><br></div><div>path( JOIN "${BASE_PATH}" "morestuff" )</div><div><br></div><div>Which would yield the cmake path:</div><div><br></div><div>"T:/stuff/morestuff"</div><div><br></div><div>Is any of this possible? How do I work around this?</div>
<div><div><br></div><div>---------</div>Robert Dailey<br>
</div>