diff --git a/BaseLib/BuildInfo.h.in b/BaseLib/BuildInfo.h.in
index 145411c6c79afdf91edc64b3ce9494a8acb3e082..42a0526dac1ba5a87b000405fa90b9d219ba6e2f 100644
--- a/BaseLib/BuildInfo.h.in
+++ b/BaseLib/BuildInfo.h.in
@@ -23,5 +23,6 @@
 #cmakedefine CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}"
 #cmakedefine CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}"
 #cmakedefine CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+#cmakedefine HOSTNAME "${HOSTNAME}"
 
 #endif // BUILDINFO_H
diff --git a/scripts/cmake/CMakeSetup.cmake b/scripts/cmake/CMakeSetup.cmake
index 0deb262cf768e6e66beecba97eda144ea824c8b6..d22d40589e22879ad16ab37f009ff3e592b0dbe2 100644
--- a/scripts/cmake/CMakeSetup.cmake
+++ b/scripts/cmake/CMakeSetup.cmake
@@ -16,3 +16,6 @@ CMAKE_POLICY(SET CMP0011 OLD)
 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.7)
 	CMAKE_POLICY(SET CMP0014 OLD)
 ENDIF ()
+
+# Get the hostname
+SITE_NAME(HOSTNAME)