How can I merge two projects?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I merge two projects?

2,644 Views
colinw
NXP Employee
NXP Employee
I have two projects at the moment.  Each project has a large number of targets which use the same source code.  Rather than having to manually create targets in one project to 'copy' those from the other, I would like to know if there is an easy way to merge the two so I have all targets in one .mcp.

Please advise.
Labels (1)
0 Kudos
4 Replies

516 Views
J2MEJediMaster
Specialist I
Use multiple build targets. To do this, first create a project that contains all of your files, say WonderBoard1. In the Project window, switch from files view to the target view by clicking on the Target tab. The project window displays the project's target name which is usually with the name of the project, WonderBoard1. Now choose Project > Create Target. A New Target dialog appears, which you can name, say "Wonderboard2". Click on Clone Existing Target to pick up all of the files and settings from the old target (WonderBoard1).

Switch back to the Files view in the Project window by clicking the Files tab. Select the WonderBoard2 from drop-down menu. Now, go to the target column in the project window and point and click to select or deselect the files needed to build the program for WonderBoard2. Go into the settings panels and make any changes, especially to the output file name. Now use the target menu to Switch back to the WonderBoard1 target, and select the files required to build a program for the WonderBoard1. Don't forget to adjust its settings panels, too, particularly the output file name.

Now you can edit the common source files, then pick the WonderBoard1 project and build the program for the WonderBoard1. If you've adjusted the settings panels properly, it will make a files named WonderBoard1.elf, or WonderBoard1.s19... After you've built that program, use the target menu to switch to the WonderBoard2 target, and do your second build. Again, if you've made your settings properly, you'll get a file named WonderBoard2.elf or WonderBoard2.s19, that uses the code unique to the WonderBoard2.

---Tom

0 Kudos

516 Views
colinw
NXP Employee
NXP Employee
Hi Tom,

Thanks for your reply.  Creating new targets individually is what I have done.  I just opened the 2 projects side-by-side and matched up the files tab.  I was looking for an easier, faster & more foolproof method.  Something like the ability to export targets from one project and import them into another.  Setting the files to use is fine but my fear is that I could have missed some settings specific to each.  I actually did stumble across some settings that I didn't know existed, because more than half of the targets did not compile.

Anyway, it is working now.  Just took a couple of hours.

Thanks again.
                         Regards,
                                         Colin
0 Kudos

516 Views
J2MEJediMaster
Specialist I
You can export settings as an XML file (File > Export)  and then import them again (File > Import). I don't know if your projects would be similar enough for that to work. The Clone Target does close to the same thing, but without involving the intermediate step of exporting/importing the XML file.

---Tom
0 Kudos

516 Views
ramp
Contributor I

Hi, 

 

I am newbie to the Metrowerks and I would like to create XML files from .mcp files. There is an option File->export project to as XML file.

 

But here is the situation. I have a main project which includes several (around 50) sub projects. If I use the IDE, I need to open each and every project and export it as XML file. Instead I am looking for an option from command line to generate XML files for a given .mcp file.

 

It looks like the exported XML file from IDE doesn't include the header files. I read somewhere in forum , the header files can be extracted from .cdt files, but no procedure found

 

Basically I need this option to compare for addition/removal of source/header files for each version of the project (Note: Main project contains several sub projects). 

 

Please let me know for any other options using IDE or command line tools.

 

Thanks,

Ram

0 Kudos