Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CWD and PWD variables for each Project
CWD and PWD variables for each Project [message #207894] Tue, 15 January 2008 08:39 Go to next message
Eclipse UserFriend
Originally posted by:


I'm wondering if someone knows a way to automatically set(and have them
stored) the environment variables CWD and PWD specified under
Project->Properties->C/C++ Build->Environment. My make files use these
variables and the default values set every time I restart eclipse breaks
my build. I therefore have to clear the values each and every time I
restart eclipse.

Setting values for them under Window->Preferences->C/C++->Environment does
not seem to help, (the PWD variable is selectable in the list shown when
clicking select, but not CWD) and the project specific settings seem to
override these anyhow.

Re: CWD and PWD variables for each Project [message #1794852 is a reply to message #207894] Fri, 07 September 2018 18:30 Go to previous messageGo to next message
Andrew Britton is currently offline Andrew BrittonFriend
Messages: 1
Registered: September 2018
Junior Member
10 years later and I'm trying to find this out as well. Did you ever get an answer?
Re: CWD and PWD variables for each Project [message #1794975 is a reply to message #1794852] Wed, 12 September 2018 04:02 Go to previous message
David VavraFriend
Messages: 804
Registered: October 2012
Senior Member
Those two are set when Eclipse starts and are equal to the location of the .project file.

Eclipse sets the current working directory for each build configuration which can be set at
Project --> Properties --> C/C++ Build --> Build directory

You can override the CWD and PWD variables yourself.
On the command line by modifying the make command at
Project --> Properties --> C/C++ Build --> Build command
e.g., make V=fred CWD=pink
sets variable V to 'fred' and CWD to 'pink'

If you are using your own makefile, in the makefile itself
Previous Topic:C/C++ Build Settings Tabs Dark Theme
Next Topic:Export Preferences->C/C++
Goto Forum:

Current Time: Mon Nov 19 22:20:24 GMT 2018

Powered by FUDForum. Page generated in 0.01407 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top