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.
This commit is contained in:
David Cole 2011-01-05 11:30:12 -05:00
parent 13caaa3eb7
commit 262da91e26
1 changed files with 8 additions and 5 deletions

View File

@ -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:
# But just use root of SystemDrive if HOME contains any spaces:
# (Default on XP and earlier...)
if(HOME MATCHES " ")
if(HOME MATCHES " " AND WIN32)
string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
endif()
if(HOME MATCHES " ")
set(HOME "")
endif()
endif()
message(STATUS "HOME='${HOME}'")