diff options
author | Brad King <brad.king@kitware.com> | 2020-10-22 14:20:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-22 14:49:17 (GMT) |
commit | 11d21c1c4e7028570e78c134b36187dbf03aaa4e (patch) | |
tree | df965f414258a7d456d3a161c75950ad4f45e7bf /Modules | |
parent | 3f3762856fbe56a244ad45995e37b3318e80b119 (diff) | |
download | CMake-11d21c1c4e7028570e78c134b36187dbf03aaa4e.zip CMake-11d21c1c4e7028570e78c134b36187dbf03aaa4e.tar.gz CMake-11d21c1c4e7028570e78c134b36187dbf03aaa4e.tar.bz2 |
CTest: Avoid invoking external tool to get the host name
Populate the SITE cache entry using an internal query instead.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CTest.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 8109108..ca9fcf5 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}") |