diff options
author | David Cole <david.cole@kitware.com> | 2011-01-05 16:30:12 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-01-05 16:30:12 (GMT) |
commit | 262da91e26e7641192549028fee40b4c62e25266 (patch) | |
tree | f0f697cd3b1fee858fcdc5e007acf01a6d31304a /Tests/VSMidl | |
parent | 13caaa3eb74a11dbf067409ea129321718d34dfe (diff) | |
download | CMake-262da91e26e7641192549028fee40b4c62e25266.zip CMake-262da91e26e7641192549028fee40b4c62e25266.tar.gz CMake-262da91e26e7641192549028fee40b4c62e25266.tar.bz2 |
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.
Diffstat (limited to 'Tests/VSMidl')
-rw-r--r-- | Tests/VSMidl/CMakeLists.txt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt index 7dd2b4d..432506c 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}'") |