summaryrefslogtreecommitdiff
path: root/Modules/CTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-22 10:20:45 -0400
committerBrad King <brad.king@kitware.com>2020-10-22 10:49:17 -0400
commit11d21c1c4e7028570e78c134b36187dbf03aaa4e (patch)
treedf965f414258a7d456d3a161c75950ad4f45e7bf /Modules/CTest.cmake
parent3f3762856fbe56a244ad45995e37b3318e80b119 (diff)
downloadcmake-11d21c1c4e7028570e78c134b36187dbf03aaa4e.tar.gz
CTest: Avoid invoking external tool to get the host name
Populate the SITE cache entry using an internal query instead.
Diffstat (limited to 'Modules/CTest.cmake')
-rw-r--r--Modules/CTest.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 8109108ec3..ca9fcf5c5e 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -194,7 +194,14 @@ if(BUILD_TESTING)
"Extra command line flags to pass to the coverage tool")
# set the site name
- site_name(SITE)
+ if(COMMAND cmake_host_system_information)
+ cmake_host_system_information(RESULT _ctest_hostname QUERY HOSTNAME)
+ set(SITE "${_ctest_hostname}" CACHE STRING "Name of the computer/site where compile is being run")
+ unset(_ctest_hostname)
+ else()
+ # This code path is needed for CMake itself during bootstrap.
+ site_name(SITE)
+ endif()
# set the build name
if(NOT BUILDNAME)
set(DART_COMPILER "${CMAKE_CXX_COMPILER}")