Przeglądaj źródła

Prohibit space in HOME value for VSMidl test.

Some Windows machines actually define HOME in their
environment. And some of them actually put a directory
with a space in the name as the value.

Make sure the HOME value (CMake variable) in this CMakeLists
file does not contain a space.
David Cole 15 lat temu
rodzic
commit
262da91e26
1 zmienionych plików z 8 dodań i 5 usunięć
  1. 8 5
      Tests/VSMidl/CMakeLists.txt

+ 8 - 5
Tests/VSMidl/CMakeLists.txt

@@ -27,12 +27,15 @@ if(NOT DEFINED HOME)
   if(NOT HOME AND WIN32)
     # Try for USERPROFILE as HOME equivalent:
     string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
+  endif()
 
-    # But just use root of SystemDrive if USERPROFILE contains any spaces:
-    # (Default on XP and earlier...)
-    if(HOME MATCHES " ")
-      string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
-    endif()
+  # But just use root of SystemDrive if HOME contains any spaces:
+  # (Default on XP and earlier...)
+  if(HOME MATCHES " " AND WIN32)
+    string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
+  endif()
+  if(HOME MATCHES " ")
+    set(HOME "")
   endif()
 endif()
 message(STATUS "HOME='${HOME}'")