Project Include Folders from Multiple Projects

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

Project Include Folders from Multiple Projects

Jump to solution
3,131 Views
chadgraham
Contributor V

Hello,

I currently have a project that pulls from other projects depending on the build configuration.  I thought that I had it working, but it seems to "remember" files and randomly pull from the projects.

Example:

I have my primary project that is specific to a design and will eventually have a custom board.  In a second project, I have stripped out everything except the pin_mux files so I can work with the dev board until the custom board is delivered.  Additionally, I have a common project that contains more generalized files and I'm treating it as a library.  In the primary project, I have added/renamed the build configurations such that I have a DevBoard_Debug, a ProjectSpecific_Debug, and Release.  For now, I'm simply trying to use the DevBoard_Debug to point to the secondary project "board" folder to pull the pin_mux files; I removed the reference to the primary "board" folder from the include folder.  However, as I walk through the code, I see files from the primary project "board" folder, the secondary project "board" folder, and the library "board" folder.

Questions:

  1. I am fairly certain that part of my problem relates to the order in which the project(s) are including the files, but I cannot seem to located a definitive list on how the files are located/sourced in any of the documentation.  Is there a list somewhere?
  2. I could simplify this if I could either assign a different name to the pin_mux files OR to specify a different folder than "board".  Is that possible?
  3. Given my situation, does anyone have any suggestions, or another approach, that might solve my situation.  (I need it to be as simplified as possible so that I can release this method of structure to other members of my team that are not as familiar with the tools.)
Tags (1)
1 Solution
3,093 Views
chadgraham
Contributor V

Hello,

After studying the above links and some experimentation, I came across a possible solution that seems to work well in my situation; I added controlled filters to the source location.  The filters appear to be specific to my build configurations and this works really well with a sample size of 1.  Not sure if this is useful to other people, but thought I'd at least share. 

View solution in original post

6 Replies
3,121 Views
ErichStyger
Senior Contributor V

1. I think the question is about #includes: here the rule is that include folders are processed in the order which is given by the -I option. You need to be a bit careful with using header files having the same name (which is not recommended) or if you are using recursive include folder structures.

2. You always could do 'link to files or folders' in your project (https://mcuoneclipse.com/2014/08/15/link-to-files-and-folders-in-eclipse/ ). I'm heavily doing this for 'common' parts similar to your project (I think). I'm think all the names and folder names for the config tools are fixed, and I don't remember a way to change this.

3. You might have a look at the structure I have used with https://github.com/ErichStyger/MetaClockClock . They do share 98% of the code and several boards/configurations have been implemented. But the config tools are still dedicated for each project.

I hope this helps,

Erich

3,116 Views
chadgraham
Contributor V

Hello ErichS,

Thank you for the prompt reply.  I am in the process of looking at your answers for #2 and #3, but I think the include folders are correct and I have the .  Do you see anything that I missed?

chadgraham_0-1628604471900.png

chadgraham_1-1628604487089.png

 

0 Kudos
3,107 Views
converse
Senior Contributor V

Try adding the -H option to the compiler which will print each include file used. You can then use the output to debug what you are doing wrong.

3,094 Views
chadgraham
Contributor V

Hello,

After studying the above links and some experimentation, I came across a possible solution that seems to work well in my situation; I added controlled filters to the source location.  The filters appear to be specific to my build configurations and this works really well with a sample size of 1.  Not sure if this is useful to other people, but thought I'd at least share. 

3,083 Views
myke_predko
Senior Contributor III

@chadgraham 

Could you provide a reference to "Controlled Filters" in Eclipse?  I couldn't find anything when I did a search.  

I'm in a similar situation and I would like to understand how this can be automated.

Thanx!

0 Kudos
3,076 Views
chadgraham
Contributor V

Hi Myke,

The filters I'm using are part of the Source Location tab.

chadgraham_0-1628710294424.png

For me, it was enough to  filter out the pin_mux files so the compiler didn't see them and it looked in the other folder.  In the ProjectSpecific and Release build configurations, I didn't add the secondary project to the include list and I didn't need to add the filter.

chadgraham_1-1628710402585.png