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.

include source outside the CCS project folder

Hi CCS Team,

let's say i have the following folder configurations:

The basic idea is that under the workspace_folder, there are several projects (e.g. project_a and project_b) which use the same source files and headers in common_source folder.

What would be the best way to include the source files and headers in common_source folder into the projects?

My idea is now to include the common sources with relative path to project location, so that when the project is imported to other workspace directory, the user shall only copy the common source folder under the new workspace, and that's it. However i have problem implementing this. Including the files using the linked resource with relative path to PROJECT_LOC is working, however when i try to add the "include path" with

"${project_loc:/../common_source}"

That seems not to work. 

Anything that i am doing here is not correct?

  • Leo,

    You are going in the right direction by using variables. To help you create and decide what is the best strategy to organize your project files, I strongly suggest checking the discussion below, as it contains several alternatives and approaches to the use and sharing of files across multiple projects.

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/189219/679630.aspx#679630

    Hope this helps,

    Rafael

  • I was able to get a project to build by using ${workspace_loc}/source as the include path.

    I get a warning in the problems view but it builds ok and if I put an error in the .h file the build fails.

  • John,

    you are right. The solution in my case is to use:

    "${workspace_loc}/common_src"

    Thanks again!

  • Hi John,

    i just realized even tough that this solution works, however it still produces warning messages that the include paths can not be found.

    Do you have any idea, why does it give the warning messages?

  • I mentioned that in my post.  I think it is because that is a special dynamic variable and must not be populated in time for whatever is checking the paths and reporting the warning.  Building is fine though.  

    I took a look at the other built-in variables and one that gets rid of the warning is:

    ${WorkspaceDirPath}

    You can get a full list of variables by going to the project properties.  Click on Build in the tree on the left, then select the variables tab on the right.  Check the box at the bottom to show system variables.

    Regards,

    John