Skip to content

Commit

Permalink
Merge pull request #13387 from tamiko/cmake_bugfix_02
Browse files Browse the repository at this point in the history
CMake: Set ${CTEST_SITE} if unset
  • Loading branch information
tamiko committed Feb 15, 2022
2 parents 09bae93 + 7b6c7a5 commit 9ed36d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/run_testsuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,12 @@ MESSAGE("-- CTEST_CMAKE_GENERATOR: ${CTEST_CMAKE_GENERATOR}")
# CTEST_SITE:
#

IF(NOT "${CTEST_SITE}" STREQUAL "")
IF("${CTEST_SITE}" STREQUAL "")
FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname)
IF(NOT "${HOSTNAME_COMMAND}" MATCHES "-NOTFOUND")
EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname)
STRING(REGEX REPLACE "\\..*$" "" _hostname ${_hostname})
SET(CTEST_SITE "${_hostname}")
ELSE()
# Well, no hostname available. What about:
SET(CTEST_SITE "BobMorane")
Expand Down

0 comments on commit 9ed36d0

Please sign in to comment.