commit ced0cd12d0dc8ec113e2139082b72e0ea964a567
parent 5688a9fb3404d58de75f811ef99be834c4a9c5a9
Author: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Thu, 16 Feb 2023 12:36:55 -0700
build: only use HOSTNAME_PRG if HOSTNAME is undefined (#22288)
Allow specifying the HOSTNAME variable by defining it with -D when
invoking CMake, instead of overriding it with the output of
HOSTNAME_RPG.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake.config/CMakeLists.txt b/cmake.config/CMakeLists.txt
@@ -188,7 +188,7 @@ elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PRG})
endif()
if (DEFINED ENV{HOSTNAME})
set(HOSTNAME $ENV{HOSTNAME})
-elseif (EXISTS ${HOSTNAME_PRG})
+elseif (NOT DEFINED HOSTNAME AND EXISTS ${HOSTNAME_PRG})
execute_process(COMMAND ${HOSTNAME_PRG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE HOSTNAME)