diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index c49008d79..c24e7f510 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -608,12 +608,6 @@ void cmGlobalVisualStudio10Generator::PathTooLong( } } -//---------------------------------------------------------------------------- -bool cmGlobalVisualStudio10Generator::UseFolderProperty() -{ - return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty(); -} - //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::IsNsightTegra() const { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 6bf47409d..8723fd1f0 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -56,9 +56,6 @@ public: cmMakefile *, bool optional); virtual void WriteSLNHeader(std::ostream& fout); - /** Is the installed VS an Express edition? */ - bool IsExpressEdition() const { return this->ExpressEdition; } - /** Generating for Nsight Tegra VS plugin? */ bool IsNsightTegra() const; std::string GetNsightTegraVersion() const; @@ -129,9 +126,6 @@ protected: bool SystemIsWindowsCE; bool SystemIsWindowsPhone; bool SystemIsWindowsStore; - bool ExpressEdition; - - bool UseFolderProperty(); private: class Factory; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 9522f6ee9..9b0035775 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -239,10 +239,10 @@ void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio11Generator::UseFolderProperty() { - // Intentionally skip over the parent class implementation and call the - // grand-parent class's implementation. Folders are not supported by the - // Express editions in VS10 and earlier, but they are in VS11 Express. - return cmGlobalVisualStudio8Generator::UseFolderProperty(); + // Intentionally skip up to the top-level class implementation. + // Folders are not supported by the Express editions in VS10 and earlier, + // but they are in VS11 Express and above. + return cmGlobalGenerator::UseFolderProperty(); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 5035fda65..d20ffbc30 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -75,6 +75,9 @@ protected: const std::set& depends); virtual void WriteSLNHeader(std::ostream& fout); + // Folders are not supported by VS 7.1. + virtual bool UseFolderProperty() { return false; } + std::string ProjectConfigurationSectionName; }; #endif diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 3abff6cb5..5c5053045 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -103,6 +103,10 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(cmake* cm, this->Name = name; this->ExtraFlagTable = this->GetExtraFlagTableVS8(); this->Version = VS8; + std::string vc8Express; + this->ExpressEdition = cmSystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\8.0\\Setup\\VC;" + "ProductDir", vc8Express, cmSystemTools::KeyWOW64_32); } //---------------------------------------------------------------------------- @@ -189,6 +193,12 @@ void cmGlobalVisualStudio8Generator::Configure() this->cmGlobalVisualStudio7Generator::Configure(); } +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio8Generator::UseFolderProperty() +{ + return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty(); +} + //---------------------------------------------------------------------------- std::string cmGlobalVisualStudio8Generator::GetUserMacrosDirectory() { diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index b3093cca0..6eb8450c4 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -66,6 +66,9 @@ public: virtual bool TargetsWindowsCE() const { return !this->WindowsCEVersion.empty(); } + /** Is the installed VS an Express edition? */ + bool IsExpressEdition() const { return this->ExpressEdition; } + protected: virtual void AddExtraIDETargets(); virtual const char* GetIDEVersion() { return "8.0"; } @@ -94,8 +97,11 @@ protected: const char* path, const cmGeneratorTarget *t); + bool UseFolderProperty(); + std::string Name; std::string WindowsCEVersion; + bool ExpressEdition; private: class Factory; diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 884f7540b..da6ffaeba 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -104,6 +104,10 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(cmake* cm, : cmGlobalVisualStudio8Generator(cm, name, platformName) { this->Version = VS9; + std::string vc9Express; + this->ExpressEdition = cmSystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0\\Setup\\VC;" + "ProductDir", vc9Express, cmSystemTools::KeyWOW64_32); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 04146fb08..9817b09df 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -92,7 +92,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() // // Organize in the "predefined targets" folder: // - if (this->UseFolderProperty() && this->GetVersion() > VS71) + if (this->UseFolderProperty()) { allBuild->SetProperty("FOLDER", this->GetPredefinedTargetsFolder()); }