From 057633151a527fc614b56f4ca3fd73f63928ebff Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Mon, 31 Oct 2011 23:37:01 +0100 Subject: 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 --- Source/cmExtraEclipseCDT4Generator.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 785e85a..eab149e 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -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 \""; -- cgit v0.12