This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RE: CCS 5: set PATH variable, include search paths for all projects of an ISA, rather than a particular project

Hi,

I added a path using Window->Preferences->Workspace->Linked Resources but I don't see the new path appear in the "includes" folder in the project. Is there something else I need to do?

thank you,

Scott

  • Hi Scott,

    I created a new post for you.  This is always better and more efficient for getting help.

    Yes, that is where you add paths for linked variables only.

    To add an include path it is in the compilers "include options" .  Project->properties->xxxx compiler->include options.

    Libraries get added in the linkers "file search path"

    See this useful wiki

    http://processors.wiki.ti.com/index.php/Include_paths_and_options

    Best Regards,
    Lisa

  • Thanks for creating a new post.


    I looked at the wiki link. I went through the options but still not sure how to create what I want.

    Or maybe I  just don't understand how it works. For example, if I put "#include <msp430.h>" in my C code, then CCS uses the "include" folder/path to find the file msp430.h.


    So, I think my question is: how does CCS know what paths to include in it's search path?


    I'd like to create a path that is seen by all the projects.  I'd like CCS to grab it upon startup so I don't have to enter includes for each project. Is this possible?


    thank you,

    Scott

  • Hi Scott,

    You I don't think you can create one for ccs, but you can create something that applies to an entire workspace.

    If you go to windows->preferences and filter for build variables, you can create a build variable to use.   This could be used to enter a directory that would then be in the include options of every project.

    I hope this helps.

    Best Regards,
    Lisa

  • Lisa,

    Thanks for the advice, I got it to work at the workspace level.

    I agree, it doesn't seem to work if I switch workspaces.

    This is unfortunate becasue I have multiple users, each with their own file system. I'd like them to be able to include the same files (copied locally), regardless of their workspace directory.


    Please let me know if this is possible.

    thanks for your help,

    Scott

  • I was hoping for an initialization file outside of CCS. That way you could edit it without running CCS, which makes  project management easier.

    If anyone knows of such a thing, please let me know.

    thank you,

    Scott

  • Hi Scott,

    I am going to seek out a few colleagues here to see if there is a way to get a build variable in like the system variables that come in ... ie that could generally become there for you in CCS.

    Cheers,
    Lisa

  • Hi Scott,

    the response from our development team is below.  

    Best regards,
    Lisa

    Pre-existing variables are configured in source code or computed at runtime by eclipse/ccs plugins. The only way that I can think that this could be achieved is to set environment variables before CCS gets started, maybe have a custom .bat file that configures those environment variables and then starts CCS. In their project include settings they could refer to those environment variables. The syntax is a bit convoluted but basically you would need to enter ${env_var:MYBUILDPATH} in include options, where MYBUILDPATH is the environment variable.

     

    Having said this most people configure their complex projects where directory layout is consistent to some common directory ancestor. That common root path can be installed anywhere, but stuff under that directory is the same across user systems. Then you use relative paths to configure projects without having to worry about any special build macros, which users have to adjust to match their system. External build variables would add an extra level of complexity that maybe could be avoided. 

  • Thank you.