redhawk icon indicating copy to clipboard operation
redhawk copied to clipboard

feature: Include environment variable in search path during redhawk-codegen

Open nimartet opened this issue 1 year ago • 0 comments

I am using Redhawk 2.10 and was trying to generate a component that uses ports defined in JTRS idl. When I tried to generate the component, I received "No such file or directory" errors when parsing IDL. I since learned that it was because the code generation does not look at any environment variables or provide search path options for codegen. After submitting a question to stackoverflow, I used the information gained to update idllib.py to parse an environment variable to add to the search path:

bash# diff idllib.py idllib.py.bak
75,80d74
<         idl_path = os.environ.get('IDL_PATH')
< 
<         if idl_path:
<             for path in idl_path.split(os.pathsep):
<                 self.addSearchPath(path)
< 

This solved my problem. Would be nice to make if official.

nimartet avatar Mar 17 '23 18:03 nimartet