diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 53 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXFilesSourceWriter.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/WiX/cmWIXFilesSourceWriter.h | 3 | ||||
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmInstalledFile.cxx | 7 | ||||
-rw-r--r-- | Source/cmInstalledFile.h | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 44 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 24 | ||||
-rw-r--r-- | Source/cmStandardIncludes.h | 6 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 5 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/kwsys/ProcessWin32.c | 17 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 12 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 10 |
18 files changed, 178 insertions, 60 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f323444..7d293ef 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140916) +set(CMake_VERSION_PATCH 20140929) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index a2995d1..744280a 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -360,6 +360,29 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile() includeFile.EndElement("Property"); } } + + if(GetOption("CPACK_WIX_PROPERTY_ARPINSTALLLOCATION") == 0) + { + includeFile.BeginElement("Property"); + includeFile.AddAttribute("Id", "INSTALL_ROOT"); + includeFile.AddAttribute("Secure", "yes"); + + includeFile.BeginElement("RegistrySearch"); + includeFile.AddAttribute("Id", "FindInstallLocation"); + includeFile.AddAttribute("Root", "HKLM"); + includeFile.AddAttribute("Key", "Software\\Microsoft\\Windows\\" + "CurrentVersion\\Uninstall\\[WIX_UPGRADE_DETECTED]"); + includeFile.AddAttribute("Name", "InstallLocation"); + includeFile.AddAttribute("Type", "raw"); + includeFile.EndElement("RegistrySearch"); + includeFile.EndElement("Property"); + + includeFile.BeginElement("SetProperty"); + includeFile.AddAttribute("Id", "ARPINSTALLLOCATION"); + includeFile.AddAttribute("Value", "[INSTALL_ROOT]"); + includeFile.AddAttribute("After", "CostFinalize"); + includeFile.EndElement("SetProperty"); + } } void cmCPackWIXGenerator::CopyDefinition( @@ -824,13 +847,37 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( cmsys::Directory dir; dir.Load(topdir.c_str()); - if(dir.GetNumberOfFiles() == 2) + std::string relativeDirectoryPath = + cmSystemTools::RelativePath(toplevel.c_str(), topdir.c_str()); + + cmInstalledFile const* directoryInstalledFile = + this->GetInstalledFile(relativeDirectoryPath); + + bool emptyDirectory = dir.GetNumberOfFiles() == 2; + bool createDirectory = false; + + if(emptyDirectory) { - std::string componentId = fileDefinitions.EmitComponentCreateFolder( - directoryId, GenerateGUID()); + createDirectory = true; + } + if(directoryInstalledFile) + { + if(directoryInstalledFile->HasProperty("CPACK_WIX_ACL")) + { + createDirectory = true; + } + } + + if(createDirectory) + { + std::string componentId = fileDefinitions.EmitComponentCreateFolder( + directoryId, GenerateGUID(), directoryInstalledFile); featureDefinitions.EmitComponentRef(componentId); + } + if(emptyDirectory) + { return; } diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx index 0ad5d0c..1adb06a 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx @@ -113,7 +113,9 @@ void cmWIXFilesSourceWriter::EmitUninstallShortcut( } std::string cmWIXFilesSourceWriter::EmitComponentCreateFolder( - std::string const& directoryId, std::string const& guid) + std::string const& directoryId, + std::string const& guid, + cmInstalledFile const* installedFile) { std::string componentId = std::string("CM_C_EMPTY_") + directoryId; @@ -127,6 +129,12 @@ std::string cmWIXFilesSourceWriter::EmitComponentCreateFolder( BeginElement("CreateFolder"); + if(installedFile) + { + cmWIXAccessControlList acl(Logger, *installedFile, *this); + acl.Apply(); + } + EndElement("CreateFolder"); EndElement("Component"); EndElement("DirectoryRef"); diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h index 23ef561..b0a4af8 100644 --- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h +++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h @@ -47,7 +47,8 @@ public: std::string EmitComponentCreateFolder( std::string const& directoryId, - std::string const& guid); + std::string const& guid, + cmInstalledFile const* installedFile); std::string EmitComponentFile( std::string const& directoryId, diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index ed19851..bc5708d 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -634,6 +634,10 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName) searchDirs.push_back(tmp); } searchDirs.push_back("/Debug"); +#if defined(__APPLE__) + std::string app = "/Debug/" + targetName + ".app"; + searchDirs.push_back(app); +#endif searchDirs.push_back("/Development"); for(std::vector<std::string>::const_iterator it = searchDirs.begin(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9a42ca2..14b5a92 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -519,9 +519,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, iter = this->SystemIncludesCache.insert(entry).first; } - std::string dirString = dir; - return std::binary_search(iter->second.begin(), iter->second.end(), - dirString); + return std::binary_search(iter->second.begin(), iter->second.end(), dir); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4375114..6a4adc0 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -506,8 +506,8 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, fpath = mf->GetModulesFile("CMakeSystemSpecificInitialize.cmake"); if(!mf->ReadListFile(0,fpath.c_str())) { - cmSystemTools::Error("Could not find cmake module file: ", - fpath.c_str()); + cmSystemTools::Error("Could not find cmake module file: " + "CMakeSystemSpecificInitialize.cmake"); } } @@ -575,7 +575,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, if(!mf->ReadListFile(0,determineFile.c_str())) { cmSystemTools::Error("Could not find cmake module file: ", - determineFile.c_str()); + determineCompiler.c_str()); } needTestLanguage[lang] = true; // Some generators like visual studio should not use the env variables @@ -627,8 +627,8 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, fpath = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake"); if(!mf->ReadListFile(0,fpath.c_str())) { - cmSystemTools::Error("Could not find cmake module file: ", - fpath.c_str()); + cmSystemTools::Error("Could not find cmake module file: " + "CMakeSystemSpecificInformation.cmake"); } } // loop over languages again loading CMake(LANG)Information.cmake @@ -744,7 +744,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, if(!mf->ReadListFile(0,ifpath.c_str())) { cmSystemTools::Error("Could not find cmake module file: ", - ifpath.c_str()); + testLang.c_str()); } std::string compilerWorks = "CMAKE_"; compilerWorks += lang; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 09ee128..50e1abb 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -540,6 +540,15 @@ void cmGlobalNinjaGenerator cmSystemTools::Error("The Ninja generator does not support Fortran yet."); } this->cmGlobalGenerator::EnableLanguage(langs, makefile, optional); + for(std::vector<std::string>::const_iterator l = langs.begin(); + l != langs.end(); ++l) + { + if(*l == "NONE") + { + continue; + } + this->ResolveLanguageCompiler(*l, makefile, optional); + } } bool cmGlobalNinjaGenerator::UsingMinGW = false; diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index 3483ecc..4b53752 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -77,6 +77,13 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf, } //---------------------------------------------------------------------------- +bool cmInstalledFile::HasProperty( + const std::string& prop) const +{ + return this->Properties.find(prop) != this->Properties.end(); +} + +//---------------------------------------------------------------------------- bool cmInstalledFile::GetProperty( const std::string& prop, std::string& value) const { diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index 0292cd1..7134a4e 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -62,6 +62,8 @@ public: void AppendProperty(cmMakefile const* mf, const std::string& prop, const char* value,bool asString=false); + bool HasProperty(const std::string& prop) const; + bool GetProperty(const std::string& prop, std::string& value) const; bool GetPropertyAsBool(const std::string& prop) const; diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index d4d565c..cb070cc 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -392,7 +392,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target) std::map<std::string, std::string> configUicOptions; if (target->GetPropertyAsBool("AUTOMOC") - || target->GetPropertyAsBool("AUTOUIC")) + || target->GetPropertyAsBool("AUTOUIC") + || target->GetPropertyAsBool("AUTORCC")) { this->SetupSourceFiles(target); } @@ -1304,8 +1305,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) const std::vector<std::string>& headerExtensions = makefile->GetHeaderExtensions(); - std::map<std::string, std::string> includedUis; - std::map<std::string, std::string> skippedUis; + std::map<std::string, std::vector<std::string> > includedUis; + std::map<std::string, std::vector<std::string> > skippedUis; std::vector<std::string> uicSkipped; cmSystemTools::ExpandListArgument(this->SkipUic, uicSkipped); @@ -1315,7 +1316,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) { const bool skipUic = std::find(uicSkipped.begin(), uicSkipped.end(), *it) != uicSkipped.end(); - std::map<std::string, std::string>& uiFiles + std::map<std::string, std::vector<std::string> >& uiFiles = skipUic ? skippedUis : includedUis; const std::string &absFilename = *it; if (this->Verbose) @@ -1376,12 +1377,17 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) { this->GenerateMoc(it->first, it->second); } - for(std::map<std::string, std::string>::const_iterator + for(std::map<std::string, std::vector<std::string> >::const_iterator it = includedUis.begin(); it != includedUis.end(); ++it) { - this->GenerateUi(it->first, it->second); + for (std::vector<std::string>::const_iterator nit = it->second.begin(); + nit != it->second.end(); + ++nit) + { + this->GenerateUi(it->first, *nit); + } } if(!this->RccExecutable.empty()) @@ -1456,9 +1462,9 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string> &includedUis) + const std::vector<std::string>& headerExtensions, + std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::vector<std::string> > &includedUis) { cmsys::RegularExpression mocIncludeRegExp( "[\n][ \t]*#[ \t]*include[ \t]+" @@ -1644,9 +1650,9 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename, void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& includedUis) + const std::vector<std::string>& headerExtensions, + std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::vector<std::string> >& includedUis) { cmsys::RegularExpression mocIncludeRegExp( "[\n][ \t]*#[ \t]*include[ \t]+" @@ -1764,7 +1770,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename, void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, - std::map<std::string, std::string>& includedUis) + std::map<std::string, std::vector<std::string> >& includedUis) { if (this->UicExecutable.empty()) { @@ -1782,8 +1788,8 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, - const std::string& contentsString, - std::map<std::string, std::string>& includedUis) + const std::string& contentsString, + std::map<std::string, std::vector<std::string> >& includedUis) { if (this->UicExecutable.empty()) { @@ -1813,7 +1819,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename, // finding the correct header, so we need to remove the ui_ part basename = basename.substr(3); - includedUis[realName] = basename; + includedUis[realName].push_back(basename); matchOffset += uiIncludeRegExp.end(); } while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset)); @@ -1859,9 +1865,9 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename, void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders, - const std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& notIncludedMocs, - std::map<std::string, std::string>& includedUis) + const std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::string>& notIncludedMocs, + std::map<std::string, std::vector<std::string> >& includedUis) { for(std::set<std::string>::const_iterator hIt=absHeaders.begin(); hIt!=absHeaders.end(); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 501e13a..c298f5d 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -51,28 +51,28 @@ private: bool GenerateUi(const std::string& realName, const std::string& uiFileName); bool GenerateQrc(); void ParseCppFile(const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& includedUis); + const std::vector<std::string>& headerExtensions, + std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::vector<std::string> >& includedUis); void StrictParseCppFile(const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& includedUis); + const std::vector<std::string>& headerExtensions, + std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::vector<std::string> >& includedUis); void SearchHeadersForCppFile(const std::string& absFilename, const std::vector<std::string>& headerExtensions, std::set<std::string>& absHeaders); void ParseHeaders(const std::set<std::string>& absHeaders, - const std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& notIncludedMocs, - std::map<std::string, std::string>& includedUis); + const std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::string>& notIncludedMocs, + std::map<std::string, std::vector<std::string> >& includedUis); void ParseForUic(const std::string& fileName, - const std::string& contentsString, - std::map<std::string, std::string>& includedUis); + const std::string& contentsString, + std::map<std::string, std::vector<std::string> >& includedUis); void ParseForUic(const std::string& fileName, - std::map<std::string, std::string>& includedUis); + std::map<std::string, std::vector<std::string> >& includedUis); void Init(); diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 3731502..8baf7b3 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -462,12 +462,6 @@ struct cmStrCmp { return strcmp(input, m_test.c_str()) == 0; } - // For use with binary_search - bool operator()(const char *str1, const char *str2) const - { - return strcmp(str1, str2) < 0; - } - private: const std::string m_test; }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index acae0b3..f4714a9 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2769,16 +2769,11 @@ const char* cmTarget::GetLocationForBuild() const // Now handle the deprecated build-time configuration location. location = this->GetDirectory(); - if(!location.empty()) - { - location += "/"; - } const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR"); if(cfgid && strcmp(cfgid, ".") != 0) { location += "/"; location += cfgid; - location += "/"; } if(this->IsAppBundleOnApple()) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a13cbd2..a8357a7 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1330,6 +1330,10 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() this->GeneratorTarget->GetAppManifest(manifestSources, ""); this->WriteSources("AppxManifest", manifestSources); + std::vector<cmSourceFile const*> certificateSources; + this->GeneratorTarget->GetCertificates(certificateSources, ""); + this->WriteSources("None", certificateSources); + std::vector<cmSourceFile const*> externalObjects; this->GeneratorTarget->GetExternalObjects(externalObjects, ""); for(std::vector<cmSourceFile const*>::iterator @@ -2122,7 +2126,10 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); - linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup"); + if (this->Target->GetType() == cmTarget::EXECUTABLE) + { + linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup"); + } } else { @@ -2134,7 +2141,10 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); - linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup"); + if (this->Target->GetType() == cmTarget::EXECUTABLE) + { + linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup"); + } } else { diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index c8ec754..ef71f26 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -36,6 +36,9 @@ a UNIX-style select system call. #pragma warning (push, 1) #endif #include <windows.h> /* Windows API */ +#if defined(_MSC_VER) && _MSC_VER >= 1800 +# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx +#endif #include <string.h> /* strlen, strdup */ #include <stdio.h> /* sprintf */ #include <io.h> /* _unlink */ @@ -335,7 +338,14 @@ kwsysProcess* kwsysProcess_New(void) windows. */ ZeroMemory(&osv, sizeof(osv)); osv.dwOSVersionInfoSize = sizeof(osv); +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (push) +# pragma warning (disable:4996) +#endif GetVersionEx(&osv); +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (pop) +#endif if(osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { /* Win9x no longer supported. */ @@ -2370,7 +2380,14 @@ static kwsysProcess_List* kwsysProcess_List_New(void) /* Select an implementation. */ ZeroMemory(&osv, sizeof(osv)); osv.dwOSVersionInfoSize = sizeof(osv); +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (push) +# pragma warning (disable:4996) +#endif GetVersionEx(&osv); +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (pop) +#endif self->NT4 = (osv.dwPlatformId == VER_PLATFORM_WIN32_NT && osv.dwMajorVersion < 5)? 1:0; diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 2521aac..84b5f39 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -60,6 +60,9 @@ #if defined(_WIN32) # include <windows.h> +# if defined(_MSC_VER) && _MSC_VER >= 1800 +# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# endif # include <errno.h> # if defined(KWSYS_SYS_HAS_PSAPI) # include <psapi.h> @@ -3786,7 +3789,7 @@ bool SystemInformationImplementation::QueryLinuxMemory() return false; } - if( unameInfo.release!=0 && strlen(unameInfo.release)>=3 ) + if( strlen(unameInfo.release)>=3 ) { // release looks like "2.6.3-15mdk-i686-up-4GB" char majorChar=unameInfo.release[0]; @@ -5063,6 +5066,10 @@ bool SystemInformationImplementation::QueryOSInformation() // Try calling GetVersionEx using the OSVERSIONINFOEX structure. ZeroMemory (&osvi, sizeof (OSVERSIONINFOEXW)); osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEXW); +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (push) +# pragma warning (disable:4996) +#endif bOsVersionInfoEx = GetVersionExW ((OSVERSIONINFOW*)&osvi); if (!bOsVersionInfoEx) { @@ -5072,6 +5079,9 @@ bool SystemInformationImplementation::QueryOSInformation() return false; } } +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (pop) +#endif switch (osvi.dwPlatformId) { diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 8a61267..b1221e3 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -82,6 +82,9 @@ # ifndef INVALID_FILE_ATTRIBUTES # define INVALID_FILE_ATTRIBUTES ((DWORD)-1) # endif +# if defined(_MSC_VER) && _MSC_VER >= 1800 +# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# endif #elif defined (__CYGWIN__) # include <windows.h> # undef _WIN32 @@ -4629,6 +4632,10 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion() ZeroMemory(&osvi, sizeof(OSVERSIONINFOEXA)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (push) +# pragma warning (disable:4996) +#endif bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi); if (!bOsVersionInfoEx) { @@ -4638,6 +4645,9 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion() return 0; } } +#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx +# pragma warning (pop) +#endif switch (osvi.dwPlatformId) { |