MantisBT - CMake
View Issue Details
0015068CMakeCMakepublic2014-08-07 10:442015-06-01 08:38
A. Klitzing 
Brad King 
normalminoralways
closedfixed 
mingwWindows7
 
CMake 3.1.1CMake 3.1.1 
0015068: Eclipse cannot run Makefile (mingw)
Since cmake 3.0 we cannot build from eclipse (tried Kepler and Luna). We uses the "eclipse cdt4 mingw"-generator on windows to create the projects. After import in eclipse there will be no reaction if we try to run the build or a special target of the Makefile.

The same workflow works with cmake 2.8.x flawlessly.

The build with cmake 3 works without problems if we use the terminal and run it manually with "mingw32-make".
1. Take your project
2. Run cmake-gui and configure the project
3. Select "eclipse cdt4 mingw" generator
4. Import from "existing project" in eclipse
5. Select "build all" or double click on a special target
6. Eclipse does nothing

Expected:
Run the makefile
No tags attached.
patch 0001-Add-org.eclipse.cdt.core.cnature-to-CXX-projects.patch (797) 2014-09-26 08:45
https://public.kitware.com/Bug/file/5262/0001-Add-org.eclipse.cdt.core.cnature-to-CXX-projects.patch
Issue History
2014-08-07 10:44A. KlitzingNew Issue
2014-08-07 10:56Brad KingAssigned To => Alex Neundorf
2014-08-07 10:56Brad KingStatusnew => assigned
2014-08-12 14:47Brad KingNote Added: 0036606
2014-09-26 07:28A. KlitzingNote Added: 0036864
2014-09-26 08:30A. KlitzingNote Added: 0036865
2014-09-26 08:35A. KlitzingNote Edited: 0036865bug_revision_view_page.php?bugnote_id=36865#r1580
2014-09-26 08:45A. KlitzingFile Added: 0001-Add-org.eclipse.cdt.core.cnature-to-CXX-projects.patch
2014-09-26 08:45A. KlitzingNote Edited: 0036865bug_revision_view_page.php?bugnote_id=36865#r1581
2015-01-15 17:45A. KlitzingNote Added: 0037708
2015-01-16 09:02Brad KingNote Added: 0037710
2015-01-16 09:03Brad KingNote Added: 0037711
2015-01-16 09:03Brad KingAssigned ToAlex Neundorf => Brad King
2015-01-16 09:03Brad KingStatusassigned => resolved
2015-01-16 09:03Brad KingResolutionopen => fixed
2015-01-16 09:03Brad KingFixed in Version => CMake 3.1.1
2015-01-16 09:03Brad KingTarget Version => CMake 3.1.1
2015-06-01 08:38Robert MaynardNote Added: 0038839
2015-06-01 08:38Robert MaynardStatusresolved => closed

Notes
(0036606)
Brad King   
2014-08-12 14:47   
I cannot reproduce this with CMake 3.0.0 or 2.8.12.2 and:

 Eclipse IDE for C/C++ Developers
 Version: Luna Release (4.4.0)

"Build All" always works the first time. After that it does nothing. If I remove build outputs by hand then "Build All" still does nothing, but if I refresh with "F5" then it works.

I observe no difference between CMake 2.8.12 and 3.0 versions.
(0036864)
A. Klitzing   
2014-09-26 07:28   
Ok, we looked into it and found a hint for it.

If we create the project with cmake 3.0 it will create a .project with following "natures".

<natures>
  <nature>org.eclipse.cdt.make.core.makeNature</nature>
  <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
  <nature>org.eclipse.cdt.core.ccnature</nature>
</natures>

If we create the project with cmake 2.8 we have the following natures.

<natures>
   <nature>org.eclipse.cdt.core.ccnature</nature>
   <nature>org.eclipse.cdt.make.core.makeNature</nature>
   <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
   <nature>org.eclipse.cdt.core.cnature</nature>
</natures>

So if we copy the nature block from 2.8 .project file to 3.0 .project file we are able to run make with eclipse again.
(0036865)
A. Klitzing   
2014-09-26 08:30   
(edited on: 2014-09-26 08:45)
Commit 51726cce64ee8bce1115f3c6d092b4ae6f43d714 seems to be the "problem". Since we added CXX in PROJECT only it won't create a cnature.
If we use CXX and C in PROJECT it will create a working .project. But of course cmake will search for a C compiler that we don't need.

We tried ECLIPSE_EXTRA_NATURES... but had no luck with it.

We created a new/empty C++ project with eclipse and looked into .project. Eclipse itself adds cnature and ccnature to it.

Attached a patch that will fix .project creation.

(0037708)
A. Klitzing   
2015-01-15 17:45   
Anyone? :-)
(0037710)
Brad King   
2015-01-16 09:02   
Re 0015068:0036865: Patch applied, thanks:

 Eclipse: Add org.eclipse.cdt.core.cnature to CXX projects
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e6e0c40 [^]

FYI, a patch will get broader visibility on the developer mailing list. See CONTRIBUTING.rst.
(0037711)
Brad King   
2015-01-16 09:03   
I've queued this for 3.1.1 since it is a regression fix.
(0038839)
Robert Maynard   
2015-06-01 08:38   
Closing resolved issues that have not been updated in more than 4 months.