Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Questions about source roots

Title: Questions about source roots

Can someone explain what a source root is exactly?

It looks like the main purpose is to define which folders the indexer should search for files under.  But it also affects the content of the CView, but in the structure and decoration of folder icons.  Then there's the new source folder wizard, and the new class wizard which only likes to create things in source folders.  Did I miss anything?

I guess what I don't understand is why have these at all?  It just seems to complicate things.  It makes more sense to me to be able to apply "do index" or "don't index" to a folder (with recursive option) under the project, or just the project itself.  And decorate the "do index" folders of course.  Then just have the normal file explorer view of the project, and get rid of the new source folder wizard.  The new class wizard could then just apply add the new class to any project folder.

Maybe there's more to it that I just haven't figured out?

The reason I bring it up is because we're having issue with some projects.  We create the project outside of the workspace where the user's sources are.  Depending on how their project is setup, the project root may end up containing many other directories that aren't a part of the actual project.  We don't want to have to index these files, but we have to because we're setting the source roots to the top level folder directly under the project.  So anything underneath there gets indexed.  If we create source roots deeper than that, the CView shows that source folder as a folder, but also shows the normal file system.  So you get some funky thing like this:

 - FooProject
   foo/bar (src root)
   - foo
     - bar

We've also had trouble with the new class wizard because it wants to create things directly under source roots, but in a large project with a deep folder structure, this is seldom the case.

Should I open a bugzilla for this discussion or am I just off base?

Thanks,
Warren


Back to the top