summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-10-06 15:46:16 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-10-06 15:46:16 (GMT)
commit444e581860fe80dc013613bd6d967db1dbed4e18 (patch)
treec480299ab48073f19964358af9a11bbcf503f8e1 /Source
parentd0c03f804f9a379e6265bab2b9d57a8ea331c2d5 (diff)
downloadCMake-444e581860fe80dc013613bd6d967db1dbed4e18.zip
CMake-444e581860fe80dc013613bd6d967db1dbed4e18.tar.gz
CMake-444e581860fe80dc013613bd6d967db1dbed4e18.tar.bz2
Added better OS information for Mac OS X
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemInformation.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 391a2c5..0a02c4c 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -242,6 +242,7 @@ protected:
// For Mac
bool ParseSysCtl();
+ void CallSwVers();
kwsys_stl::string ExtractValueFromSysCtl(const char* word);
kwsys_stl::string SysCtlBuffer;
@@ -3369,12 +3370,39 @@ bool SystemInformationImplementation::QueryOSInformation()
this->OSVersion = unameInfo.version;
this->OSPlatform = unameInfo.machine;
}
+#ifdef __APPLE__
+ this->CallSwVers();
+#endif
#endif
return true;
}
+void SystemInformationImplementation::CallSwVers()
+{
+#ifdef __APPLE__
+ kwsys_stl::string output;
+ kwsys_stl::vector<const char*> args;
+ args.clear();
+ args.push_back("sw_vers");
+
+ args.push_back("-productName");
+ output = this->RunProcess(args);
+ this->OSName = output;
+ args.pop_back();
+
+ args.push_back("-productVersion");
+ output = this->RunProcess(args);
+ this->OSRelease = output;
+ args.pop_back();
+
+ args.push_back("-buildVersion");
+ output = this->RunProcess(args);
+ this->OSVersion = output;
+#endif
+}
+
/** Return true if the machine is 64 bits */
bool SystemInformationImplementation::Is64Bits()
{