I do not understand what you are saying in the last post, but i made a script that goes through the active project and adds all folders with include files in it to the include search directories under build options.
Feel free to test, but i give no guarantee that it will work. Make a copy of your project first...
local CheckIfPathIsInProjectList = function (path)
{
local includeArray = GetProjectManager().GetActiveProject().GetIncludeDirs();
for(local i = 0; i < includeArray.GetCount(); ++i)
{
if(includeArray.Item(i).tostring() == path)
return true;
}
return false;
}
print("#### Script begin #####");
local project = GetProjectManager().GetActiveProject();
print("Work on project: " + project.GetTitle());
local fileCount = project.GetFilesCount();
print("Number of files in project " + fileCount);
// Itearete trought the files
for(local i = 0; i < fileCount ;++i)
{
local ProjectFile = project.GetFile(i);
if(ProjectFile.file.GetExt().tostring() == "h") // Check if file is a header file
{
local includePath = ProjectFile.relativeFilename.BeforeLast('/').tostring();
if( CheckIfPathIsInProjectList(includePath) == false)
{
project.AddIncludeDir(_T(includePath));
print("Add folder: " + includePath);
project.SetModified(true);
}
}
}
print("#### Script end #####");
To run the script copy and paste the above in a new text file. rename it with the file ending
Open the project in question and open the script console with View->Scripting console
open the script from the console with clicking on the second button.
As soon as you open the script it will run. If you are working on windows you may have to adjust the path delimiter in line 27
If your header files have different fileextension as "h" you have to modify it in line 25.
hope this helps.
PS: i found a bug in squirrel or SQPlus, i am not sure:
you can not call the function
on a project variable passed through a function parameter.