diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 092e5b9..1e45813 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -67,12 +67,55 @@ void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p, cmMakefile* mf) { - if (!this->PlatformInGeneratorName) { - this->GeneratorPlatform = p; - return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf); - } else { + if (this->PlatformInGeneratorName) { + // This is an old-style generator name that contains the platform name. + // No explicit platform specification is supported, so pass it through + // to our base class implementation, which errors on non-empty platforms. return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform(p, mf); } + + this->GeneratorPlatform = p; + + // FIXME: Add CMAKE_GENERATOR_PLATFORM field to set the framework. + // For now, just report the generator's default, if any. + if (cm::optional<std::string> const& targetFrameworkVersion = + this->GetTargetFrameworkVersion()) { + mf->AddDefinition("CMAKE_VS_TARGET_FRAMEWORK_VERSION", + *targetFrameworkVersion); + } + if (cm::optional<std::string> const& targetFrameworkIdentifier = + this->GetTargetFrameworkIdentifier()) { + mf->AddDefinition("CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER", + *targetFrameworkIdentifier); + } + if (cm::optional<std::string> const& targetFrameworkTargetsVersion = + this->GetTargetFrameworkTargetsVersion()) { + mf->AddDefinition("CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION", + *targetFrameworkTargetsVersion); + } + + // The generator name does not contain the platform name, and so supports + // explicit platform specification. We handled that above, so pass an + // empty platform name to our base class implementation so it does not error. + return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf); +} + +cm::optional<std::string> const& +cmGlobalVisualStudio8Generator::GetTargetFrameworkVersion() const +{ + return this->DefaultTargetFrameworkVersion; +} + +cm::optional<std::string> const& +cmGlobalVisualStudio8Generator::GetTargetFrameworkIdentifier() const +{ + return this->DefaultTargetFrameworkIdentifier; +} + +cm::optional<std::string> const& +cmGlobalVisualStudio8Generator::GetTargetFrameworkTargetsVersion() const +{ + return this->DefaultTargetFrameworkTargetsVersion; } std::string cmGlobalVisualStudio8Generator::GetGenerateStampList() |