diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-05-06 22:44:45 +0200 |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-05-06 22:44:45 +0200 |
commit | a7d8d49b8fc829e76686cbc4cc808db4a8542994 (patch) | |
tree | a0e708e9dfc970b0a87a712a8022b19f2ffd7fac | |
parent | 303c7e8f4087c9096e7544c327f83557582821f3 (diff) | |
download | cmake-a7d8d49b8fc829e76686cbc4cc808db4a8542994.tar.gz |
-fix VirtualFolders in Eclipse under Windows
Under Windows "locationURI" must be used for virtual folders, while
"location" must be used only for linked folders. Under Linux it doesn't
seem to matter.
Alex
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 15 | ||||
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.h | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index c4ea425144..8e26b8ee2b 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -403,7 +403,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() // 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]", - "virtual:/virtual"); + "virtual:/virtual", true); for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator it = this->GlobalGenerator->GetProjectMap().begin(); @@ -1082,17 +1082,24 @@ void cmExtraEclipseCDT4Generator void cmExtraEclipseCDT4Generator ::AppendLinkedResource (cmGeneratedFileStream& fout, const std::string& name, - const std::string& path) + const std::string& path, + bool isVirtualFolder) { + const char* locationTag = "location"; + if (isVirtualFolder) // ... and not a linked folder + { + locationTag = "locationURI"; + } + fout << "\t\t<link>\n" "\t\t\t<name>" << cmExtraEclipseCDT4Generator::EscapeForXML(name) << "</name>\n" "\t\t\t<type>2</type>\n" - "\t\t\t<locationURI>" + "\t\t\t<" << locationTag << ">" << cmExtraEclipseCDT4Generator::EscapeForXML(path) - << "</locationURI>\n" + << "</" << locationTag << ">\n" "\t\t</link>\n" ; } diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 99e69c42a1..a6837313b3 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -87,7 +87,8 @@ private: static void AppendLinkedResource (cmGeneratedFileStream& fout, const std::string& name, - const std::string& path); + const std::string& path, + bool isVirtualFolder = false); bool AppendOutLinkedResource(cmGeneratedFileStream& fout, const std::string& defname, |