ENV paths with backslashes

Peter Kümmel syntheticpp at gmx.net
Sat Feb 11 16:45:23 CET 2006


I've found the reason for not scanning for dependencies:

When I get a environment variable with $ENV the backslashes
are not replaced:


CMakeLists.txt:
set(test0 $ENV{TESTVAR})

STRING( REGEX REPLACE "\\\\" "/" test1 ${test0} )

set(inc0 ${test0}/include )
set(inc1 ${test1}/include )

message(STATUS "inc0 -${inc0}-")
message(STATUS "inc1 -${inc1}-")



cmd.exe:
set testvar = c:\aaa\bbb ccc
cmake .


Output:
-- inc0 -c:\aaa\bbb ccc/include-
-- inc1 -c:/aaa/bbb ccc/include-


Passing the slash/backslash mixed include path to nmake then
breaks the scanning for dependencies.


Adding the regex to FindKDE4 resolves the problem of not scanning:

      IF (MS_SDK_DIR)
         STRING( REGEX REPLACE "\\\\" "/" MS_SDK_DIR_SLASHED ${MS_SDK_DIR} )
         SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDES} ${MS_SDK_DIR_SLASHED}/include )
      ENDIF (MS_SDK_DIR)



Do we need this regex in FindKDE4 or is it a bug of ENV?

Peter


More information about the Kde-buildsystem mailing list