Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Duplicating Eclipse project settings(environment variable settings don't get copied)
Duplicating Eclipse project settings [message #509976] Mon, 25 January 2010 23:28 Go to next message
Alex Stupakov is currently offline Alex StupakovFriend
Messages: 3
Registered: January 2010
Junior Member
Hi all,

I have an existing project for which the source came from CVS, and I have lots of project-specific settings in Eclipse. I'd like to create another project with all the same settings but referring to a different version of the code (a branch checked out from CVS).

So far, I've done the following:
* right click on my existing project, edit->copy, edit-> paste. this creates a duplicate project.
* closed eclipse* deleted all the source code in the new directory (but kept .project and .cproject and .settings/, which contains a preference file with the environment variables.)
* checked out the branch from cvs into this location
* re-opened Eclipse, opened the project, and refreshed it to get the updated source tree. team info in eclipse reflects the new cvs checkout.

Most of the settings have been copied over as expected.
The problem I have now is that the Environment variables I had set in C/C++ Buld -> Environment did not get copied.

Even if I click "Manage Configurations..." and import the configuration from my original project into the new one, the Env Vars don't get imported.

I also tried File->Export->C/C++ Project Settings to export to an .xml file and import to the new project, and that didn't really do anything.

Can anyone suggest how to export/import the environment variables from one project to another, or a better way of applying one project's settings to another?

Thanks

Alex

[Updated on: Mon, 25 January 2010 23:40]

Report message to a moderator

Re: Duplicating Eclipse project settings [message #509989 is a reply to message #509976] Tue, 26 January 2010 01:44 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
Alex Stupakov wrote:
> Hi all,
>
> I have an existing project for which the source came from CVS, and I
> have lots of project-specific settings in Eclipse. I'd like to create
> another project with all the same settings but referring to a different
> version of the code (a branch checked out from CVS).
>
> So far, I've done the following:
> * right click on my existing project, edit->copy, edit-> paste. this
> creates a duplicate project.
> * closed eclipse* deleted all the source code in the new directory (but
> kept .project and .cproject)
> * checked out the branch from cvs into this location
> * re-opened Eclipse, opened the project, and refreshed it to get the
> updated source tree. team info in eclipse reflects the new cvs checkout.
>
> Most of the settings have been copied over as expected.
> The problem I have now is that the Environment variables I had set in
> C/C++ Buld -> Environment did not get copied.
>
> Even if I click "Manage Configurations..." and import the configuration
> from my original project into the new one, the Env Vars don't get imported.
>
> I'm under the impression that the env vars should be associated with a
> configuration (switching configs on my original project switches the set
> of env vars).
>
> I also tried File->Export->C/C++ Project Settings to export to an .xml
> file and import to the new project, and that didn't really do anything.
>
> Can anyone suggest how to export/import the environment variables from
> one project to another, or a better way of applying one project's
> settings to another?
>
> Thanks
>
> Alex

I'm not sure exactly how the C/C++ plugin handles project specific
settings, but the Eclipse recommended way is to place them in the
..settings folder in the project folder. Look there to see if you can
see a .settings folder and copy that to the new project.

FYI. You should check the .settings folder, the .project, and the
..cproject file into CVS to make sure that you have them in the future.
Re: Duplicating Eclipse project settings [message #521556 is a reply to message #509989] Thu, 18 March 2010 02:14 Go to previous message
Alex Stupakov is currently offline Alex StupakovFriend
Messages: 3
Registered: January 2010
Junior Member
There is a .project file, a .cproject file, and a .settings directory with a file called .settings/org.eclipse.cdt.core.prefs

The .cproject file and .prefs file save the project-specific preferences and the .prefs file actually contains the env vars I'm trying to restore when I copy my project.

Both of those files have entries with a unique project identifier, and it's consistent between the two files.
It's declared in .cproject: <cconfiguration id="0.457444512">
and used in both files, for example:
environment/project/0.457444512= ....

I've also tried copying my entire directory (including source, hidden files, everything) to a totally new location, creating a new workspace, and doing a project import (specifying this new path). Again, env vars don't get imported, though they're in the .prefs file in the project directory.

Perhaps eclipse stores a mapping between the project identifier and source path somewhere in its own prefs (not in the project dir?) and this causes problems?

Any other ideas/suggestions would be appreciated.
Thanks.
Previous Topic:Debugger found the wrong source file - how to fix?
Next Topic:Change output file name
Goto Forum:
  


Current Time: Thu Apr 25 07:08:26 GMT 2024

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

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

Back to the top