• AVR Freaks

AnsweredHot!How to get loadable project's path?

Author
rioru
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/04/01 03:34:03
  • Location: 0
  • Status: offline
2020/02/26 02:08:06 (permalink)
0

How to get loadable project's path?

Hi,
I want to include file from a loadable project to my main project, but I need to extract the path of that loadable project to do so.
Is there a way to do that?
And vice versa, is there a way to get path of the main project from included project?
Thank you.
post edited by rioru - 2020/02/26 02:17:29
#1
Jim Nickerson
User 452
  • Total Posts : 6566
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 07:53:30 (permalink)
0
When I click Add Loadable it lets me browse to the location.
Since you generated the project to be loaded, where did you put it ?
#2
rioru
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/04/01 03:34:03
  • Location: 0
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:03:53 (permalink)
0
Thank for the reply.
I know where the project is lcoated, but I want to know the location using some kind of IDE variable, so I don't have to explicitly write the full path. There are might be many different projects that load other different projects, so that variable has to point to loadable project.
#3
Jim Nickerson
User 452
  • Total Posts : 6566
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:10:56 (permalink)
0
You could parse the "configurations.xml" file using an external tool run before compiling the project
what do you intend to do with this path information ? 
#4
rioru
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/04/01 03:34:03
  • Location: 0
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:24:33 (permalink)
0
I actually more interested of knowing the main project location from the loadable project. That way I could include a certain header file from the main project.
For example, several different main projects load a bootloader project. Every main project has some hardware configuration file that should be included inside the bootloader project, but stored in the main project. Bootloader should load the correct file judging from which of the main projects it was loaded. If I could get a path to a main project into some IDE variable PATH, I could write something like this:
#include "$PATH/configs.h"
and the correct file would load.
#5
Jim Nickerson
User 452
  • Total Posts : 6566
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:37:18 (permalink) ☼ Best Answerby rioru 2020/02/26 08:58:03
+1 (1)
maybe the main project could use an external program to create a file containing the main file path which was subsequently included by the bootloader
using
 ${ProjectDir} 
macro during building and passing it to the external program that creates "special.h" included by the bootloader.
#6
rioru
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/04/01 03:34:03
  • Location: 0
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:51:51 (permalink)
0
Thank you for suggestion. In that case it would be easier to call an 'external program' which simply copies current project's configs.h into bootloader project, which bootloader would include. Is there a way to call this 'external program' during the project build?
#7
Jim Nickerson
User 452
  • Total Posts : 6566
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:56:56 (permalink) ☄ Helpfulby rioru 2020/02/26 08:57:25
+1 (1)
I use this
Attachments are not available: Download requirements not met
 

Attachment(s)

Attachments are not available: Download requirements not met
#8
rioru
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2019/04/01 03:34:03
  • Location: 0
  • Status: offline
Re: How to get loadable project's path? 2020/02/26 08:57:55 (permalink)
+1 (1)
Oh, of course. Thank you!
#9
Jump to:
© 2020 APG vNext Commercial Version 4.5