[cmake-developers] generator expression for path slash conversion (was: ExternalProject: Use native paths as substitute for directory tokens)

Brad King brad.king at kitware.com
Fri Aug 28 09:59:34 EDT 2015


On 08/28/2015 04:06 AM, CHEVRIER, Marc wrote:
> Offering generator-expressions is a very good idea because it offers
> a global solution to this problem.
> 
> Now regarding the name of the generator, may be TO_NATIVE_PATH is
> not judicious, (even if problems explained in
> http://www.cmake.org/Bug/view.php?id=5939 are, in my point of view,
> linked to platforms not well handled rather than wrong semantic of
> TO_NATIVE_PATH) but PATH_FOR_SHELL is, as well, ambiguous at least
> for two reasons:
> * commands defined in add_custom_command, for example, are directly
>   executed without any shell evolved

No, add_custom_command results in a generated build system rule for
the specified command, and that always runs in a shell at build time.
One can see the conversions done properly internally to CMake for
generating references to source and object files on toolchain command
lines, for example.

> * A system can have multiple shells supporting different paths syntax.
>   For example, on windows, my shell is tcsh which handle paths with '/'
>   rather than '\'

It would be defined as the shell in which the build system will run
the commands.  We should choose a name accordingly.

-Brad



More information about the cmake-developers mailing list