diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-07-16 19:38:31 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-07-16 19:38:31 (GMT) |
commit | 79c298e12c3f2c5a50d599123bf711c6e72248a0 (patch) | |
tree | 9df20623a186eed3b3109a29904a3c884b2c5c9f /Source/cmGlobalGenerator.cxx | |
parent | 8ca5266645c5fa3d65728508a8eb3c6ebe30c1f6 (diff) | |
download | CMake-79c298e12c3f2c5a50d599123bf711c6e72248a0.zip CMake-79c298e12c3f2c5a50d599123bf711c6e72248a0.tar.gz CMake-79c298e12c3f2c5a50d599123bf711c6e72248a0.tar.bz2 |
ENH: set CMAKE_SYSTEM_VERSION for windows
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 48251f1..96706d8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,6 +20,10 @@ #include "cmMakefile.h" #include <stdlib.h> // required for atof +#if defined(_WIN32) && !defined(__CYGWIN__) +#include <windows.h> +#endif + cmGlobalGenerator::cmGlobalGenerator() { // do nothing duh @@ -38,7 +42,7 @@ cmGlobalGenerator::~cmGlobalGenerator() void cmGlobalGenerator::EnableLanguage(const char* lang, - cmMakefile *mf) + cmMakefile *mf) { if(m_FindMakeProgramFile.size() == 0) { @@ -93,6 +97,17 @@ void cmGlobalGenerator::EnableLanguage(const char* lang, !this->GetLanguageEnabled("C") && !this->GetLanguageEnabled("CXX") && !this->GetLanguageEnabled("JAVA")) { +#if defined(_WIN32) && !defined(__CYGWIN__) + /* Windows version number data. */ + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(osvi)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx (&osvi); + cmOStringStream windowsVersionString; + windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; + windowsVersionString.str(); + mf->AddDefinition("CMAKE_SYSTEM_VERSION", windowsVersionString.str().c_str()); +#endif // Read the DetermineSystem file std::string systemFile = root; systemFile += "/Modules/CMakeDetermineSystem.cmake"; |