diff options
author | Gilles Khouzam <gillesk@microsoft.com> | 2015-09-10 20:53:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-11 15:21:53 (GMT) |
commit | 4734df5f79d7101bf425f21065ab5c853bacc388 (patch) | |
tree | e82385cfeebc0863ef598a965b04c80359e290a9 | |
parent | 8e8824149fb6525f1a6da5f9c825a67765ce240b (diff) | |
download | CMake-4734df5f79d7101bf425f21065ab5c853bacc388.zip CMake-4734df5f79d7101bf425f21065ab5c853bacc388.tar.gz CMake-4734df5f79d7101bf425f21065ab5c853bacc388.tar.bz2 |
Windows: Set CMAKE_HOST_SYSTEM_VERSION with three components
Call GetVersionEx with OSVERSIONINFOEX instead of OSVERSIONINFO so that
we can get the dwBuildNumber as a third version component.
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ee1b192..33b04ac 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -433,19 +433,22 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, { #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows version number data. */ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(osvi)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + OSVERSIONINFOEXW osviex; + ZeroMemory(&osviex, sizeof(osviex)); + osviex.dwOSVersionInfoSize = sizeof(osviex); + #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) # pragma warning (disable:4996) #endif - GetVersionEx (&osvi); + GetVersionExW((OSVERSIONINFOW*)&osviex); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) #endif std::ostringstream windowsVersionString; - windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; + windowsVersionString << osviex.dwMajorVersion << "." + << osviex.dwMinorVersion << "." + << osviex.dwBuildNumber; windowsVersionString.str(); mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", windowsVersionString.str().c_str()); |