aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-10-08 14:22:36 -0400
committerJames McCoy <jamessan@jamessan.com>2016-10-08 14:22:36 -0400
commit9b0b281b75b1183c0a1bb0134e7c1c8d0ae966a7 (patch)
treeb991b5df5073b335ffc8a9062b78e9476ec2efb1
parent19840728228f66c7f2af88dfc4bcecc26ffa064b (diff)
downloadrneovim-9b0b281b75b1183c0a1bb0134e7c1c8d0ae966a7.tar.gz
rneovim-9b0b281b75b1183c0a1bb0134e7c1c8d0ae966a7.tar.bz2
rneovim-9b0b281b75b1183c0a1bb0134e7c1c8d0ae966a7.zip
config: Allow setting USERNAME/HOSTNAME from the environment
Allowing this to be controlled externally improves reproducibility, as well as provides a more useful address to report for "Compiled by". For example, I intend to set it to the packaging list when building the Debian package. Signed-off-by: James McCoy <jamessan@jamessan.com>
-rw-r--r--config/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index cf84f8c6a4..a16000aba8 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -142,12 +142,16 @@ configure_file (
find_program(WHOAMI_PROG whoami)
find_program(HOSTNAME_PROG hostname)
-if (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
+if (DEFINED ENV{USERNAME})
+ set(USERNAME $ENV{USERNAME})
+elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
execute_process(COMMAND ${WHOAMI_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE USERNAME)
endif()
-if (EXISTS ${HOSTNAME_PROG})
+if (DEFINED ENV{HOSTNAME})
+ set(HOSTNAME $ENV{HOSTNAME})
+elseif (EXISTS ${HOSTNAME_PROG})
execute_process(COMMAND ${HOSTNAME_PROG}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE HOSTNAME)