Why not using multiple projects in a workspace?
Your approach would mean to copy the concept of projects in workspaces to targets in projects
I don't see the benefit of your idea.
I have two "packages" in Cmake, both become a project in VC and Codeblocks. You could say that a package is a set of subprojects, containing libraries and samples. Those all are targets. Libraries in a package belong together, and the samples are based on those libraries.
A package has its own include directories and libraries, flags etc.
A package is a hierarchy of directories, where in sub directories one defined targets for libraries and samples. But on top of that one can tell cmake that a set of targets belong to a (sub)project. The top project is the name of the package. The projects defined in subdirectory CmakeList.txt files, are below that.
The second package uses the first package, but has his own library targets and samples, and include directories, flag settings etc. It calls/uses wxdocview-config(.cmake) to get the settings from the first package. For instance i use 3 packages ( wxWidgets a2dDocview wxArt2D a2dAgg). They are standalone by itself, still i like to develop them together in Codeblocks. Especially when the package are depending on each other a lot, this is handy.
Like in VC i think such a "package" level is missing. It becomes a flat set of projects coming from all packages.
But in Codeblocks it is possible to use a project as a package. Are maybe i should say a project is a package, which i think it is.
But what about the subprojects i defined within a package. Well it is just a second view on top of the targets. One view is via the directory structure. And the other one is via subprojects. I think that is the whole idea of using virtual folders. Even if i did not defined subprojects, but just want to look at my targets grouped in a different way, that would be done using virtual directories. The only thing is that i can not have the file for a certain target in two different virtual dirs like a link.
But if you forget about subprojects, maybe the next makes it clear why i like to have the second view:
For the wxart2d package my include dirs look like:
c:\data\art2d\trunk\wxArt2D\packages\wxart2d\include\wx\aggdrawer
c:\data\art2d\trunk\wxArt2D\packages\wxart2d\include\wx\artbase
etc.
The source directories are like this.
c:\data\art2d\trunk\wxArt2D\packages\wxart2d\aggdrawer\src
c:\data\art2d\trunk\wxArt2D\packages\wxart2d\artbase\src
artbase and aggdrawer are both library targets. And of course i like to see/browse them in the IDE as follows:
artbase/includes/file1.h
artbase/includes/file2.h
artbase/sources/file1.cpp
artbase/sources/file2.cpp
aggdrawer/includes/file3.h
aggdrawer/includes/file4.h
aggdrawer/sources/file3.cpp
aggdrawer/sources/file4.cpp
It is not a project, it is just looking at the files if a target in a different way.
Not via the directory structure, but via files belong to targets.
All very well possible in CodeBlocks, the only problem again, if a file is shared by two targets there is a problem. e.g. 2 samples use the same file containing some extra code which can be shared by several examples. It is not a library, just some code. That file i can not add to two different virtual directories.
Hope it became more clear :-)