summaryrefslogtreecommitdiffstats
path: root/Source/cmSiteNameCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-04-25 19:40:04 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-04-25 19:40:04 (GMT)
commit9b0a90fa9ec2da35125c1d9f987cc9a19fd0ad7c (patch)
tree807c81c4b02f5f771629e031eba3be119b0c9d3a /Source/cmSiteNameCommand.cxx
parent303b77ad4cd3d3f80c0d520e5fd36412ea24b2ad (diff)
downloadCMake-9b0a90fa9ec2da35125c1d9f987cc9a19fd0ad7c.zip
CMake-9b0a90fa9ec2da35125c1d9f987cc9a19fd0ad7c.tar.gz
CMake-9b0a90fa9ec2da35125c1d9f987cc9a19fd0ad7c.tar.bz2
fix up hostname for windows
Diffstat (limited to 'Source/cmSiteNameCommand.cxx')
-rw-r--r--Source/cmSiteNameCommand.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index f91599a..5a66a9f 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -44,9 +44,17 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
}
std::string siteName = "unknown";
-
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ std::string host;
+ if(cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\ComputerName\\ComputerName;ComputerName",
+ host))
+ {
+ siteName = host;
+ }
+#else
// try to find the hostname for this computer
- if (hostname_cmd.length())
+ if (!cmSystemTools::IsOff(hostname_cmd.c_str()))
{
std::string host;
cmSystemTools::RunCommand(hostname_cmd.c_str(),
@@ -80,7 +88,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
}
// try to find the domain name for this computer
- if (nslookup_cmd.length())
+ if (!cmSystemTools::IsOff(nslookup_cmd.c_str()))
{
nslookup_cmd += " ";
nslookup_cmd += host;
@@ -104,7 +112,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
}
}
}
-
+#endif
m_Makefile->
AddCacheDefinition(args[0].c_str(),
siteName.c_str(),