[cmake-developers] Question/problem with cmSourceGroup
Alexander Neundorf
neundorf at kde.org
Sun Oct 16 08:07:09 EDT 2011
Hi,
I'm currently trying to add support for the source_group() command to the
Eclipse project generator.
It's not as straighforward as I expected.
I expected that if I do
source_group(Foo FILES main.cpp)
in the CMakeLists.txt, that then in the generate step, there would be a
cmSourceGroup object with that name ("Foo"), this is indeed the case, and that
I then could simply iterate over the files of this source group, which would
give me "main.cpp". This is not the case.
The source_group() command puts main.cpp into the member std::set<cmStdString>
GroupFiles of cmSourceGroup, and cmSourceGroup::GetSourceFiles() returns the
member std::vector<const cmSourceFile*> SourceFiles; which is empty in my
case.
So, how should source groups be handled in the Eclipse generator ?
There are already "links" to the source dir and to each project-dir, so the
groups would only provide additional, well, grouping.
But cmSourceGroup::GroupFiles is private and I don't see a way to access it,
the only place I found where its contents are read is in
cmSourceGroup::MatchesFiles(), but there its contents are compared with a
function argument, so it still doesn't give me read-access to the set of added
files.
Alex
More information about the cmake-developers
mailing list