CTest: Avoid invoking external tool to get the host name

Populate the SITE cache entry using an internal query instead.
This commit is contained in:
Brad King
2020-10-22 10:20:45 -04:00
parent 3f3762856f
commit 11d21c1c4e

View File

@@ -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}")