MantisBT - CMake
View Issue Details
0012579CMakeCMakepublic2011-11-14 18:362016-06-10 14:31
Dan Kegel 
Alex Neundorf 
normalfeaturealways
closedmoved 
CMake 2.8.6 
 
0012579: Improve project generator for eclipse to handle multiple top level directories
See discussion at
http://www.cmake.org/pipermail/cmake/2011-November/047435.html [^]

If CMakeLists.txt points to a distant directory, e.g.
  add_subdirectory(../foo foo)
the projects generated by the existing cdt generator have two problems:
1) even if -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE is given, the ../foo directory is not exposed as a project in the gui
2) eclipse does not trigger a build when source files in directory ../foo
are changed.

The first problem can be solved by adding a dummy project in ../foo
just as is done in the primary source directory (though, please, use
a better name, like [_foo])

The second problem requires adding a <link> item in the main .project,
pointing to the foo directory.

I do those two things in a shell script after running cmake, but that
means I have to re-run my shell script by hand after every change
to any CMakeLists.txt, and it'd be nicer to have cmake's cdt generator
do it for me.
See example at
http://code.google.com/p/winezeug/source/browse/trunk/cmake_examples/ex7/ [^]
No tags attached.
related to 0012223closed Alex Neundorf Support of linked resources in Eclipse/CDT (single files, not folders) 
Issue History
2011-11-14 18:36Dan KegelNew Issue
2011-11-15 11:47Alex NeundorfAssigned To => Alex Neundorf
2011-11-15 11:47Alex NeundorfStatusnew => assigned
2011-11-15 11:48Alex NeundorfRelationship addedrelated to 0012223
2011-11-15 20:31Dan KegelNote Added: 0027805
2011-11-19 05:27Alex NeundorfNote Added: 0027831
2011-12-16 17:24David ColeTarget Version => CMake 2.8.7
2011-12-18 11:07David ColeNote Added: 0028003
2011-12-18 11:07David ColeTarget VersionCMake 2.8.7 =>
2012-08-03 16:13Alex NeundorfNote Added: 0030166
2012-08-13 12:42Alex NeundorfNote Added: 0030569
2012-08-13 12:42Alex NeundorfStatusassigned => backlog
2016-02-23 08:46ThiagoNote Added: 0040520
2016-02-23 10:57ThiagoNote Added: 0040521
2016-06-10 14:28Kitware RobotNote Added: 0041934
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027805)
Dan Kegel   
2011-11-15 20:31   
The other constraint worth noting is that the Team menu should be active
for all source files so e.g. Subclipse can be used on them.
Current cmake master doesn't have this property.
(0027831)
Alex Neundorf   
2011-11-19 05:27   
In the cmake next branch now in the source project there are also links created to each project() directory.
Can you please check whether the revision control works there ?

And, ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT has been renamed to CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT , so please enable this one (cmake will also warn you about this).
(0028003)
David Cole   
2011-12-18 11:07   
There is perhaps more work to do on this issue... so we're leaving it open for future work, and unsetting the target version field, since more fixes related to it are unlikely to be done in time for 2.8.7...
(0030166)
Alex Neundorf   
2012-08-03 16:13   
Any progress here, Dan ?
(0030569)
Alex Neundorf   
2012-08-13 12:42   
I don't think I'll work on this for 2.8.10.
(0040520)
Thiago   
2016-02-23 08:46   
I think 2) might be fixed, but 1) still reproducing on CMAke 3.4.3.

I mean, for 1) ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT does not iterate through all add_subdirectories() calls to create all the .project files in all source directories. That is specially bad if you use GIT integration on Eclipse, for instance - only the first project (parent) will have VCS and all the others will not

2) However, if we do some change in any source-code of subdirectories added by add_subdirectory(), the project is recompiled properly

Both features are great and doesn't seem to be too complex to implement. Any chance we have it fixed ?
(0040521)
Thiago   
2016-02-23 10:57   
Just as an amend, where I've written ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT, please, read CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT =)
(0041934)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.