diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-10-17 21:45:02 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2012-10-17 21:45:02 (GMT) |
commit | fbda95883c3a86e5b808c78fa433bd9dbcc93754 (patch) | |
tree | 47cedf8200e21e64f780c1b56a3ed8303a70df1d /Source | |
parent | 7ded904329635b490467ddf06d87b2620da470aa (diff) | |
download | CMake-fbda95883c3a86e5b808c78fa433bd9dbcc93754.zip CMake-fbda95883c3a86e5b808c78fa433bd9dbcc93754.tar.gz CMake-fbda95883c3a86e5b808c78fa433bd9dbcc93754.tar.bz2 |
Eclipse: add switch to disable linked resources (#13189)
Eclipse may get confused by these linked resources, because it sees
the same source file multiple times then and doesn't recognize
that it's the same file actually.
Alex
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 13 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 689f213..ca7379e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -38,6 +38,7 @@ cmExtraEclipseCDT4Generator this->SupportedGlobalGenerators.push_back("Unix Makefiles"); this->SupportsVirtualFolders = true; + this->GenerateLinkedResources = true; } //---------------------------------------------------------------------------- @@ -83,6 +84,9 @@ void cmExtraEclipseCDT4Generator::Generate() this->HomeDirectory = mf->GetHomeDirectory(); this->HomeOutputDirectory = mf->GetHomeOutputDirectory(); + this->GenerateLinkedResources = mf->IsOn( + "CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES"); + this->IsOutOfSourceBuild = (this->HomeDirectory!=this->HomeOutputDirectory); this->GenerateSourceProject = (this->IsOutOfSourceBuild && @@ -501,6 +505,10 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets( linkName2 += ti->first; this->AppendLinkedResource(fout, linkName2, "virtual:/virtual", VirtualFolder); + if (!this->GenerateLinkedResources) + { + break; // skip generating the linked resources to the source files + } std::vector<cmSourceGroup> sourceGroups=makefile->GetSourceGroups(); // get the files from the source lists then add them to the groups cmTarget* tgt = const_cast<cmTarget*>(&ti->second); @@ -555,6 +563,11 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets( void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects( cmGeneratedFileStream& fout, const std::string& baseDir) { + if (!this->GenerateLinkedResources) + { + return; + } + // for each sub project create a linked resource to the source dir // - only if it is an out-of-source build this->AppendLinkedResource(fout, "[Subprojects]", diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 37ce65e..31ad68d 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -109,6 +109,7 @@ private: std::string HomeOutputDirectory; bool IsOutOfSourceBuild; bool GenerateSourceProject; + bool GenerateLinkedResources; bool SupportsVirtualFolders; }; |