ENV paths with backslashes

Peter Kümmel syntheticpp at gmx.net
Sat Feb 11 17:52:44 CET 2006


Alexander Neundorf wrote:
>> Usage: macro_getenv_win_path(MSSDK_INCLUDE_DIR MSSDK)
> 

I've tested it, and it works!

Index: cmake/modules/FindKDE4.cmake
===================================================================
--- cmake/modules/FindKDE4.cmake	(Revision 508152)
+++ cmake/modules/FindKDE4.cmake	(Arbeitskopie)
@@ -182,6 +182,10 @@
    SET(_KDE4_PLATFORM_INCLUDE_DIRS ${X11_INCLUDE_DIR} )
 ENDIF(UNIX AND NOT APPLE)

+macro(MACRO_GETENV_WIN_PATH var name)
+   set(${var} $ENV{${name}})
+   string( REGEX REPLACE "\\\\" "/" ${var} ${${var}} )
+endmacro(MACRO_GETENV_WIN_PATH var name)


 IF (WIN32)
@@ -220,7 +224,8 @@
       SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDE_DIR} ${KDEWIN32_INCLUDE_DIR}/msvc  ${QT_INCLUDES})

       # add the MS SDK include directory if available
-      SET(MS_SDK_DIR $ENV{MSSdk})
+      macro_getenv_win_path(MS_SDK_DIR MSSdk)
+      #SET(MS_SDK_DIR $ENV{MSSdk})
       IF (MS_SDK_DIR)
          SET(KDEWIN32_INCLUDES ${KDEWIN32_INCLUDES} ${MS_SDK_DIR}/include )
       ENDIF (MS_SDK_DIR)


> Will this then have to be used for all paths which come from an windows 
> environment variable ?

Yes, I fear. Maybe cmake could provide a ENVDIR function, if they don't want so
change ENV.

Peter



More information about the Kde-buildsystem mailing list