[CMake] problem on windows with $ENV{something}

William A. Hoffman billlist at nycap.rr.com
Sun Feb 12 09:46:54 EST 2006


At 09:21 AM 2/12/2006, Alexander Neundorf wrote:
>Hi, 
> 
>it seems there's an issue with using $ENV{something} under windows, as 
>can be read here and followups: 
>http://mail.kde.org/pipermail/kde-buildsystem/2006-February/001083.html 
> 
>The problems is that if the environment variable contains backslahes (and 
>maybe spaces), it breaks the dependency scanning of cmake, i.e. 
>dependencies are not scanned. This has been reported for nmake. 
> 
>A workaround is to replace all backslahes to forward slashes using 
>string(regex replace ...) 
> 
>Is this a bug or a feature ? 

The problem is that CMake expects all paths to be unix style paths.
ENV on Windows is likely to produce a windows path with \ and not /,
that is likely to mess up the cmake parser.  So, should CMake ENV
try to convert slashes?   The problem is, it may or may not be a PATH.
We could check to see if it is a PATH?  Or we could create ENVPath{var}.
Ideas, suggestions?

Thanks.

-Bill




More information about the CMake mailing list