Summary: | Custom project: Project/Project Options/Make Options/Environment Variables have no effect. | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | John W Eckhart <jeckhart> |
Component: | Build tools: Custom Makefiles | Assignee: | KDevelop Developers <kdevelop-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | This patch is based off of of the code from similar parts of other projects. |
Description
John W Eckhart
2003-06-30 19:35:03 UTC
Looks like someone forgot to implement this :) If you have a patch, you can send it to the kdevelop-devel mailing-list or directly to me ( harry at kdevelop dot org ). Best regards, Harry Created attachment 1914 [details]
This patch is based off of of the code from similar parts of other projects.
To apply:
1) Copy the patch to the source dir:
cp ./kdevelop-3.0a4a.patch /src/kdevelop-3.0a4a/)
2) Goto the source dir:
cd /src/kdevelop-3.0a4a/
3) Apply the patch
patch -Np1 -i ./kdevelop-3.0a4a.patch
4) Configure and make
Subject: kdevelop/parts/customproject CVS commit by aclu: Fix Project/Project Options/Make Options/Environment Variables have no effect Patch by: John W Eckhart < jeckhart in us.ibm.com > Thanks for the patch!!! CCMAIL: 60546-done@bugs.kde.org M +26 -0 customprojectpart.cpp 1.52 M +1 -0 customprojectpart.h 1.14 --- kdevelop/parts/customproject/customprojectpart.cpp #1.51:1.52 @@ -332,4 +332,29 @@ QString CustomProjectPart::buildDirector +QString CustomProjectPart::makeEnvironment() +{ + // Get the make environment variables pairs into the environstr string + // in the form of: "ENV_VARIABLE=ENV_VALUE" + // Note that we quote the variable value due to the possibility of + // embedded spaces + DomUtil::PairList envvars = + DomUtil::readPairListEntry(*projectDom(), "/kdevcustomproject/make/envvars", "envvar", "name", "value"); + + QString environstr; + DomUtil::PairList::ConstIterator it; + for (it = envvars.begin(); it != envvars.end(); ++it) { + environstr += (*it).first; + environstr += "="; +#if (KDE_VERSION > 305) + environstr += KProcess::quote((*it).second); +#else + environstr += KShellProcess::quote((*it).second); +#endif + environstr += " "; + } + return environstr; +} + + void CustomProjectPart::startMakeCommand(const QString &dir, const QString &target) { @@ -374,4 +399,5 @@ void CustomProjectPart::startMakeCommand dircmd += " && "; + cmdline.prepend(makeEnvironment()); makeFrontend()->queueCommand(dir, dircmd + cmdline); } --- kdevelop/parts/customproject/customprojectpart.h #1.13:1.14 @@ -70,4 +70,5 @@ private: void populateProject(); void startMakeCommand(const QString &dir, const QString &target); + QString makeEnvironment(); QString m_projectDirectory; |