Eclipse: create links to subprojects also in the source-project (#12579)
Alex
This commit is contained in:
parent
8e1bbee4d9
commit
1110e455c2
@ -113,7 +113,7 @@ void cmExtraEclipseCDT4Generator::Generate()
|
|||||||
this->CreateCProjectFile();
|
this->CreateCProjectFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() const
|
void cmExtraEclipseCDT4Generator::CreateSourceProjectFile()
|
||||||
{
|
{
|
||||||
assert(this->HomeDirectory != this->HomeOutputDirectory);
|
assert(this->HomeDirectory != this->HomeOutputDirectory);
|
||||||
|
|
||||||
@ -141,6 +141,16 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() const
|
|||||||
"\t</buildSpec>\n"
|
"\t</buildSpec>\n"
|
||||||
"\t<natures>\n"
|
"\t<natures>\n"
|
||||||
"\t</natures>\n"
|
"\t</natures>\n"
|
||||||
|
"\t<linkedResources>\n";
|
||||||
|
|
||||||
|
if (this->SupportsVirtualFolders)
|
||||||
|
{
|
||||||
|
this->CreateLinksToSubprojects(fout, this->HomeDirectory);
|
||||||
|
this->SrcLinkedResources.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
fout <<
|
||||||
|
"\t</linkedResources>\n"
|
||||||
"</projectDescription>\n"
|
"</projectDescription>\n"
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -434,7 +444,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
|||||||
|
|
||||||
if (this->SupportsVirtualFolders)
|
if (this->SupportsVirtualFolders)
|
||||||
{
|
{
|
||||||
this->CreateLinksToSubprojects(fout);
|
this->CreateLinksToSubprojects(fout, this->HomeOutputDirectory);
|
||||||
|
|
||||||
this->CreateLinksForTargets(fout);
|
this->CreateLinksForTargets(fout);
|
||||||
}
|
}
|
||||||
@ -541,7 +551,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
|
void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
|
||||||
cmGeneratedFileStream& fout)
|
cmGeneratedFileStream& fout, const std::string& baseDir)
|
||||||
{
|
{
|
||||||
// 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
|
||||||
@ -557,8 +567,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
|
|||||||
it->second[0]->GetMakefile()->GetStartDirectory());
|
it->second[0]->GetMakefile()->GetStartDirectory());
|
||||||
// a linked resource must not point to a parent directory of .project or
|
// a linked resource must not point to a parent directory of .project or
|
||||||
// .project itself
|
// .project itself
|
||||||
if ((this->HomeOutputDirectory != linkSourceDirectory) &&
|
if ((baseDir != linkSourceDirectory) &&
|
||||||
!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
|
!cmSystemTools::IsSubDirectory(baseDir.c_str(),
|
||||||
linkSourceDirectory.c_str()))
|
linkSourceDirectory.c_str()))
|
||||||
{
|
{
|
||||||
std::string linkName = "[Subprojects]/";
|
std::string linkName = "[Subprojects]/";
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// create .project file in the source tree
|
// create .project file in the source tree
|
||||||
void CreateSourceProjectFile() const;
|
void CreateSourceProjectFile();
|
||||||
|
|
||||||
// create .project file
|
// create .project file
|
||||||
void CreateProjectFile();
|
void CreateProjectFile();
|
||||||
@ -104,7 +104,8 @@ private:
|
|||||||
static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
|
static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
|
||||||
cmMakefile* mf);
|
cmMakefile* mf);
|
||||||
|
|
||||||
void CreateLinksToSubprojects(cmGeneratedFileStream& fout);
|
void CreateLinksToSubprojects(cmGeneratedFileStream& fout,
|
||||||
|
const std::string& baseDir);
|
||||||
void CreateLinksForTargets(cmGeneratedFileStream& fout);
|
void CreateLinksForTargets(cmGeneratedFileStream& fout);
|
||||||
|
|
||||||
std::vector<std::string> SrcLinkedResources;
|
std::vector<std::string> SrcLinkedResources;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user