diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0c85a044..6876e61 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -37,6 +37,7 @@ static cmVS7FlagTable cmVS7ExtraFlagTable[] = { cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue }, { "PrecompiledHeaderThrough", "Yu", "Precompiled Header Name", "", cmVS7FlagTable::UserValueRequired }, + { "UsePrecompiledHeader", "Y-", "Don't use precompiled header", "0", 0 }, { "WholeProgramOptimization", "LTCG", "WholeProgramOptimization", "true", 0 }, @@ -107,14 +108,7 @@ void cmGlobalVisualStudio7Generator::EnableLanguage( { mf->AddDefinition("CMAKE_GENERATOR_RC", "rc"); mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); - if (!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) { - mf->AddCacheDefinition( - "CMAKE_CONFIGURATION_TYPES", "Debug;Release;MinSizeRel;RelWithDebInfo", - "Semicolon separated list of supported configuration types, " - "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, " - "anything else will be ignored.", - cmStateEnums::STRING); - } + mf->InitCMAKE_CONFIGURATION_TYPES("Debug;Release;MinSizeRel;RelWithDebInfo"); // Create list of configurations requested by user's cache, if any. this->cmGlobalVisualStudioGenerator::EnableLanguage(lang, mf, optional); @@ -303,6 +297,25 @@ void cmGlobalVisualStudio7Generator::Generate() this->CallVisualStudioMacro(MacroReload, GetSLNFile(this->LocalGenerators[0].get())); } + + if (this->Version == VS10 && !this->CMakeInstance->GetIsInTryCompile()) { + std::string cmakeWarnVS10; + if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue( + "CMAKE_WARN_VS10")) { + this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS10"); + cmakeWarnVS10 = *cached; + } else { + cmSystemTools::GetEnv("CMAKE_WARN_VS10", cmakeWarnVS10); + } + if (cmakeWarnVS10.empty() || !cmIsOff(cmakeWarnVS10)) { + this->CMakeInstance->IssueMessage( + MessageType::WARNING, + "The \"Visual Studio 10 2010\" generator is deprecated " + "and will be removed in a future version of CMake." + "\n" + "Add CMAKE_WARN_VS10=OFF to the cache to disable this warning."); + } + } } void cmGlobalVisualStudio7Generator::OutputSLNFile( @@ -342,17 +355,17 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( if (!target->IsInBuildSystem()) { continue; } - cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT"); + cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT"); if (expath) { std::set<std::string> allConfigurations(configs.begin(), configs.end()); - cmProp mapping = target->GetProperty("VS_PLATFORM_MAPPING"); + cmValue mapping = target->GetProperty("VS_PLATFORM_MAPPING"); this->WriteProjectConfigurations(fout, target->GetName(), *target, configs, allConfigurations, mapping ? *mapping : ""); } else { const std::set<std::string>& configsPartOfDefaultBuild = this->IsPartOfDefaultBuild(configs, projectTargets, target); - cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { this->WriteProjectConfigurations(fout, *vcprojName, *target, configs, configsPartOfDefaultBuild); @@ -374,18 +387,17 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( bool written = false; // handle external vc project files - cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT"); + cmValue expath = target->GetProperty("EXTERNAL_MSPROJECT"); if (expath) { std::string project = target->GetName(); std::string location = *expath; - this->WriteExternalProject( - fout, project, location, - cmToCStr(target->GetProperty("VS_PROJECT_TYPE")), - target->GetUtilities()); + this->WriteExternalProject(fout, project, location, + target->GetProperty("VS_PROJECT_TYPE"), + target->GetUtilities()); written = true; } else { - cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { cmLocalGenerator* lg = target->GetLocalGenerator(); std::string dir = lg->GetCurrentBinaryDirectory(); @@ -438,7 +450,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends( if (!target->IsInBuildSystem()) { continue; } - cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); + cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { std::string dir = target->GetLocalGenerator()->GetCurrentSourceDirectory(); @@ -526,7 +538,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections( extensibilityAddInsOverridden = true; } fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n"; - cmProp p = root->GetMakefile()->GetProperty(it); + cmValue p = root->GetMakefile()->GetProperty(it); std::vector<std::string> keyValuePairs = cmExpandedList(p ? *p : ""); for (std::string const& itPair : keyValuePairs) { const std::string::size_type posEqual = itPair.find('='); @@ -625,7 +637,7 @@ std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend( std::string cmGlobalVisualStudio7Generator::GetGUID(std::string const& name) { std::string const& guidStoreName = name + "_GUID_CMAKE"; - if (cmProp storedGUID = + if (cmValue storedGUID = this->CMakeInstance->GetCacheDefinition(guidStoreName)) { return *storedGUID; } @@ -675,7 +687,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( "CMAKE_VS_INCLUDE_" + t + "_TO_DEFAULT_BUILD"; // inspect CMAKE_VS_INCLUDE_<t>_TO_DEFAULT_BUILD properties for (std::string const& i : configs) { - cmProp propertyValue = + cmValue propertyValue = target->Target->GetMakefile()->GetDefinition(propertyName); if (propertyValue && cmIsOn(cmGeneratorExpression::Evaluate( |