summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-02 13:28:14 (GMT)
committerBrad King <brad.king@kitware.com>2017-11-03 15:30:21 (GMT)
commitbbc9c96691c06cdcff0227ad8292e2a2ea60ec00 (patch)
treeb964371cd17444e532318fed81764a961c3c179c /Tests/CMakeLists.txt
parent51e0d611f5732c40bf31662a0ba5e43cca0d40a6 (diff)
downloadCMake-bbc9c96691c06cdcff0227ad8292e2a2ea60ec00.zip
CMake-bbc9c96691c06cdcff0227ad8292e2a2ea60ec00.tar.gz
CMake-bbc9c96691c06cdcff0227ad8292e2a2ea60ec00.tar.bz2
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 c25fc44..bd44b17 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()