summaryrefslogtreecommitdiff
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-02 09:28:14 -0400
committerBrad King <brad.king@kitware.com>2017-11-03 11:30:21 -0400
commitbbc9c96691c06cdcff0227ad8292e2a2ea60ec00 (patch)
treeb964371cd17444e532318fed81764a961c3c179c /Tests/CMakeLists.txt
parent51e0d611f5732c40bf31662a0ba5e43cca0d40a6 (diff)
downloadcmake-bbc9c96691c06cdcff0227ad8292e2a2ea60ec00.tar.gz
Tests: Honor already-set CTEST_REAL_HOME in case of repeat run
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index c25fc44d70..bd44b17f3b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -31,7 +31,9 @@ if(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME)
set(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one.
# But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that
# need access to the real HOME directory.
-set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
+if(NOT DEFINED ENV{CTEST_REAL_HOME})
+ set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\")
+endif()
set(ENV{HOME} \"${TEST_HOME}\")
")
endif()