diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index cfb28ead2..ef6d408b2 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -36,7 +36,6 @@ IF(UNIX) ELSE(UNIX) IF(WIN32) SET (CMAKE_SYSTEM_NAME "Windows") - SET (CMAKE_SYSTEM_VERSION "") SET (CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") ENDIF(WIN32) ENDIF(UNIX) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 48251f171..96706d8ef 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -20,6 +20,10 @@ #include "cmMakefile.h" #include // required for atof +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#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";