summaryrefslogtreecommitdiffstats
path: root/Source/cmStateSnapshot.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmStateSnapshot.cxx')
-rw-r--r--Source/cmStateSnapshot.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index c6288a5..80e494b 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -18,6 +18,10 @@
#include "cmVersion.h"
#include "cmake.h"
+#if !defined(_WIN32)
+#include <sys/utsname.h>
+#endif
+
#if defined(__CYGWIN__)
#include "cmSystemTools.h"
#endif
@@ -298,9 +302,15 @@ void cmStateSnapshot::SetDefaultDefinitions()
#if defined(_WIN32)
this->SetDefinition("WIN32", "1");
this->SetDefinition("CMAKE_HOST_WIN32", "1");
+ this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", "Windows");
#else
this->SetDefinition("UNIX", "1");
this->SetDefinition("CMAKE_HOST_UNIX", "1");
+
+ struct utsname uts_name;
+ if (uname(&uts_name) == 0) {
+ this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname);
+ }
#endif
#if defined(__CYGWIN__)
std::string legacy;