summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraEclipseCDT4Generator.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-10-15 17:40:21 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-10-15 17:40:21 (GMT)
commit5b200e3bed8e450027ddad42a155d670f247e58c (patch)
tree7e3da4cca2ead4eae401d4a8c91eb0df9c47b618 /Source/cmExtraEclipseCDT4Generator.cxx
parent4974ec90a4f4d688b8beac603f7da9ed690d4827 (diff)
downloadCMake-5b200e3bed8e450027ddad42a155d670f247e58c.zip
CMake-5b200e3bed8e450027ddad42a155d670f247e58c.tar.gz
CMake-5b200e3bed8e450027ddad42a155d670f247e58c.tar.bz2
Detect whether the current Eclipse version supports VirtualFolders
VirtualFolders are supported since 3.6 (Helios). Next patch will be to actually make use of the new flag SupportsVirtualFolders. Alex
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 7beffdc..21b1b61 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -34,6 +34,8 @@ cmExtraEclipseCDT4Generator
// this->SupportedGlobalGenerators.push_back("MSYS Makefiles");
#endif
this->SupportedGlobalGenerators.push_back("Unix Makefiles");
+
+ this->SupportsVirtualFolders = true;
}
//----------------------------------------------------------------------------
@@ -57,6 +59,24 @@ void cmExtraEclipseCDT4Generator::Generate()
const cmMakefile* mf
= this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
+ std::string eclipseVersion = mf->GetSafeDefinition("CMAKE_ECLIPSE_VERSION");
+ cmsys::RegularExpression regex(".*([0-9]+\\.[0-9]+).*");
+ if (regex.find(eclipseVersion.c_str()))
+ {
+ unsigned int majorVersion = 0;
+ unsigned int minorVersion = 0;
+ int res=sscanf(regex.match(1).c_str(), "%u.%u", &majorVersion,
+ &minorVersion);
+ if (res == 2)
+ {
+ int version = majorVersion * 1000 + minorVersion;
+ if (version < 3006) // 3.6 is Helios
+ {
+ this->SupportsVirtualFolders = false;
+ }
+ }
+ }
+
// TODO: Decide if these are local or member variables
this->HomeDirectory = mf->GetHomeDirectory();
this->HomeOutputDirectory = mf->GetHomeOutputDirectory();