how to copy and entire project

General questions regarding the usage of CodeLite
User avatar
zaphod
CodeLite Veteran
Posts: 55
Joined: Fri Sep 11, 2009 6:20 pm
Contact:

how to copy and entire project

Post by zaphod »

I have a project with around 300+ source files. I want to duplicate the entire project prior to editing it before making it open source. Is there a nice easy way of making a project copy ?

I can do it the hard way: copy the actual source files into new directories then load them into the new projects virtual folders. But then there all the project settings to be copied -- that gets to be a drag :roll:

Suggestions please...

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: how to copy and entire project

Post by DavidGH »

Hi,

There's not (afaik) a 'Duplicate Project' command, but it needn't be hard to do by hand. Suppose I have a workspace called FooWsp containing a project RealPrj.
1) Duplicate the actual files: use your file manager/terminal to duplicate/rename the containing directory.
2) Then do one of the following alternatives:

  • a) Similarly, duplicate the workspace's project directory e.g. /path/to/FooWsp/RealPrj/ and call it DupPrj. It should contain a file that's currently called RealPrj.project. Rename it. Open it in a text editor and make the obvious alteration to the line:
    <CodeLite_Project Name="RealPrj" ....>
    There will also be lines similar to:
    <VirtualDirectory Name="foo">
    <File Name="path/to/file1.cpp"/>
    Make any necessary alterations.
    Then, in CodeLite with the original workspace open, Workspace > Add existing project.
    In the Workspace View right-click over DupPrj and select Reconcile Project to check that the files/folders are all present and correct.

  • b) Use Workspace > New project to create DupPrj.
    Add the files/folders: In the Workspace View right-click over DupPrj and select either 'Import files from directory' or, for more complicated projects, Reconcile Project.

Regards,

David

User avatar
zaphod
CodeLite Veteran
Posts: 55
Joined: Fri Sep 11, 2009 6:20 pm
Contact:

Re: how to copy and entire project

Post by zaphod »

Well, I "think" I went through the appropriate steps you suggested. However, when I try and build the copied project Codelite crashes. I tried the 'reconcile' option but it seemed to simply want me to assign files that are already part of the project. I had hoped it would simply 'reconcile' the project in some way...

Rather obviously, messing with XML configuration file can really mess with things... :cry:

Back to doing things the hard way. Copying and then importing files is easy. I just wish there were more facilities for duplicating compiler and linker settings between projects.

User avatar
zaphod
CodeLite Veteran
Posts: 55
Joined: Fri Sep 11, 2009 6:20 pm
Contact:

Re: how to copy and entire project

Post by zaphod »

What does "save as template" do ? Might this help me ?

User avatar
zaphod
CodeLite Veteran
Posts: 55
Joined: Fri Sep 11, 2009 6:20 pm
Contact:

Re: how to copy and entire project

Post by zaphod »

I hacked around and I have solved my problem. Thanks for your suggestion.

Post Reply