-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
This commit is contained in:
parent
303c7e8f40
commit
a7d8d49b8f
|
@ -403,7 +403,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
// for each sub project create a linked resource to the source dir
|
// for each sub project create a linked resource to the source dir
|
||||||
// - only if it is an out-of-source build
|
// - only if it is an out-of-source build
|
||||||
this->AppendLinkedResource(fout, "[Subprojects]",
|
this->AppendLinkedResource(fout, "[Subprojects]",
|
||||||
"virtual:/virtual");
|
"virtual:/virtual", true);
|
||||||
|
|
||||||
for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
|
for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
|
||||||
it = this->GlobalGenerator->GetProjectMap().begin();
|
it = this->GlobalGenerator->GetProjectMap().begin();
|
||||||
|
@ -1082,17 +1082,24 @@ void cmExtraEclipseCDT4Generator
|
||||||
void cmExtraEclipseCDT4Generator
|
void cmExtraEclipseCDT4Generator
|
||||||
::AppendLinkedResource (cmGeneratedFileStream& fout,
|
::AppendLinkedResource (cmGeneratedFileStream& fout,
|
||||||
const std::string& name,
|
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 <<
|
fout <<
|
||||||
"\t\t<link>\n"
|
"\t\t<link>\n"
|
||||||
"\t\t\t<name>"
|
"\t\t\t<name>"
|
||||||
<< cmExtraEclipseCDT4Generator::EscapeForXML(name)
|
<< cmExtraEclipseCDT4Generator::EscapeForXML(name)
|
||||||
<< "</name>\n"
|
<< "</name>\n"
|
||||||
"\t\t\t<type>2</type>\n"
|
"\t\t\t<type>2</type>\n"
|
||||||
"\t\t\t<locationURI>"
|
"\t\t\t<" << locationTag << ">"
|
||||||
<< cmExtraEclipseCDT4Generator::EscapeForXML(path)
|
<< cmExtraEclipseCDT4Generator::EscapeForXML(path)
|
||||||
<< "</locationURI>\n"
|
<< "</" << locationTag << ">\n"
|
||||||
"\t\t</link>\n"
|
"\t\t</link>\n"
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,8 @@ private:
|
||||||
|
|
||||||
static void AppendLinkedResource (cmGeneratedFileStream& fout,
|
static void AppendLinkedResource (cmGeneratedFileStream& fout,
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& path);
|
const std::string& path,
|
||||||
|
bool isVirtualFolder = false);
|
||||||
|
|
||||||
bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
|
bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
|
||||||
const std::string& defname,
|
const std::string& defname,
|
||||||
|
|
Loading…
Reference in New Issue