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
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to