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.
Part Number: CCSTUDIO-C2000
Tool/software: Code Composer Studio
Hi All,
Using CCS 7.2:
I have a large build composed of a main project (producing an .out file) and multiple auxiliary projects (producing library files).
The auxiliary projects are all dependencies of the main project.
Each project (main and/or auxiliary) has several configurations (typically more than two, not limited to the usual Debug / Release scheme).
What I am trying to achieve is to define in the main project some kind of variable (say DEP_LIB_PATH) that would contain something like:
${PROJECT_ROOT)/libs/${ProjName}/${ConfigName}
DEP_LIB_PATH would then be used in the auxiliary projects to figure out where to put the output of the archiver: The archiver output would be defined with something like
${DEP_LIB_PATH}/${ProjName}.lib
(note that the latter ${ProjName} is the library ProjName, not the main project ProjName, since it is used in the auxiliary project).
I'm trying here to avoid hardcoding different DEP_LIB_PATH all over the place for each possible main project configuration, or even worse, for each main / auxiliary project configuration combination.
Now my problems are:
Bottom line is, I'm very confused. :)
Is what I'm trying to do possible at all?
Could anyone of you All shed some light?
Thanks in advance! /Ph.
P.S.:
I have read (not necessarily properly understood! :-) ) the following TI references:
Portable Projects:
processors.wiki.ti.com/.../Portable_Projects
Project Macros:
processors.wiki.ti.com/.../Project_Macros
Using CCS variables in source code:
processors.wiki.ti.com/.../Using_CCS_Variables_in_source_code
Linking files (workspace vs project path variables)
processors.wiki.ti.com/.../Portable_Projects
Filofel said:What I am trying to achieve is to define in the main project some kind of variable (say DEP_LIB_PATH) that would contain something like:
${PROJECT_ROOT)/libs/${ProjName}/${ConfigName}
DEP_LIB_PATH would then be used in the auxiliary projects to figure out where to put the output of the archiver: The archiver output would be defined with something like
${DEP_LIB_PATH}/${ProjName}.lib
(note that the latter ${ProjName} is the library ProjName, not the main project ProjName, since it is used in the auxiliary project).
I don't think this will work as you intend. First, you cannot define a variable in the main project and have it visible within the library project, unless you define it at a workspace level, in which case it will be visible to all projects within the workspace.
Also, if a variable DEP_LIB_PATH is defined relative to other variables like ${PROJECT_ROOT), ${ProjName}, ${ConfigName} etc, when it gets resolved all the variables will be pertinent to the project that is active at that time, so it will not help your situation.
One way to achieve what you are looking for would be to let the library project create the output .lib in its default path, then in the main project add a pre-build step that copies the library from the library project into the desired path within the main project. This is what comes to mind so far, but I'll give it some more thought and will add further comments if I can think of another way to achieve this. Perhaps others in the community will also chime in with their suggestions.
Thanks AartiG,
Yes, I figured out the locality of ${ProjName}, ${ConfigName} quite early in my quest :) . That's actually the reason why I tried all the ways I could think of to work around that and define a more global (or workspace) variable that I could see from other projects - only to find none: But creating some workspace (global) variable from inside a project does not seem to be an available feature.
AartiG said:let the library project create the output .lib in its default path, then in the main project add a pre-build step that copies the library from the library project into the desired path within the main project.
The problem I have with this is the risk of having duplicate copies of libraries around the place in term of automatic building detection by the make mechanisms... Plus it requires specific "out of band" manual tweaking in a not-so-usual place whenever the project is modified in any way (maintenance problem). I was looking for something a bit more regular and universal, where the same link and target syntax could be used for all dependent projects.
My dream mechanism would be one where a project could create variables visible from its own dependencies as well as from itself. And/or could pass variables to each of its dependencies (just like it passes the dependency the config name it should use for its build).
If anyone else has found the magic bullet, I'm still open for any trick for more dynamic communication between master and dependent projects!
TIA, /Ph.