Eclipse: make targets work from any directory

Set the working directory for make targets which are associated
to virtual folders, otherwise Eclipse simply runs make from the
current working directory (where Eclipse has been started), and
where probably not the correct makefile is located.

Alex
This commit is contained in:
Alex Neundorf 2011-10-31 23:37:01 +01:00
parent 07e88ae449
commit 057633151a
1 changed files with 5 additions and 1 deletions

View File

@ -998,7 +998,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::string virtDir = "[Targets]/";
virtDir += prefix;
virtDir += ti->first;
this->AppendTarget(fout, "Build", make, makeArgs, virtDir, "",
std::string buildArgs = "-C ";
buildArgs += makefile->GetHomeOutputDirectory();
buildArgs += " ";
buildArgs += makeArgs;
this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "",
ti->first.c_str());
std::string cleanArgs = "-E chdir \"";