From 262da91e26e7641192549028fee40b4c62e25266 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 5 Jan 2011 11:30:12 -0500 Subject: [PATCH] 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. --- Tests/VSMidl/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt index 7dd2b4dee..432506c3b 100644 --- a/Tests/VSMidl/CMakeLists.txt +++ b/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}'")