[cmake-developers] [CMake 0013699]: Errors are not cleared when rebuilding a CMake-generated Eclipse CDT project

Mantis Bug Tracker mantis at public.kitware.com
Sat Nov 17 18:42:25 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13699 
====================================================================== 
Reported By:                vitaut
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13699
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-11-17 18:42 EST
Last Modified:              2012-11-17 18:42 EST
====================================================================== 
Summary:                    Errors are not cleared when rebuilding a
CMake-generated Eclipse CDT project
Description: 
Some errors from previous builds are not cleared when rebuilding a
CMake-generated Eclipse CDT project.  Most of the errors are cleared but the
following three persist in the Problems view:

make[1]: *** [CMakeFiles/test.dir/all] Error 2			 	C/C++ Problem
make: *** [all] Error 2			 	C/C++ Problem
make[2]: *** [CMakeFiles/test.dir/test.cc.o] Error 1			 	C/C++ Problem

These errors persist even if the project builds successfully which can be
checked by looking at the Console output.

I am using Eclipse CDT version 8.1.0.

Steps to Reproduce: 
1. Create a simple C/C++ CMake project with a syntax error in the source code,
for example,

CMakeFiles.txt:
  cmake_minimum_required(VERSION 2.6)
  project(TEST)
  add_executable(test test.cc)

test.cc:
  int main() {
    return 0 // missing semicolon
  }

2. Generate Eclipse CDT project:
cmake -G "Eclipse CDT4 - Unix Makefiles"

3. Open the project in Eclipse and build it. The Problems view will contain the
following errors:
make[1]: *** [CMakeFiles/test.dir/all] Error 2			 	C/C++ Problem
make: *** [all] Error 2			 	C/C++ Problem
make[2]: *** [CMakeFiles/test.dir/test.cc.o] Error 1			 	C/C++ Problem
expected ‘;’ before ‘}’ token	test.cc	/TEST at test	line 3	C/C++ Problem

4. Fix the error (add a semicolon after 0 in the example above), save the file
and build the project again. The Problems view will contain the following
errors:
make[1]: *** [CMakeFiles/test.dir/all] Error 2			 	C/C++ Problem
make: *** [all] Error 2			 	C/C++ Problem
make[2]: *** [CMakeFiles/test.dir/test.cc.o] Error 1			 	C/C++ Problem

Additional Information: 
Changing the error parser from "CDT GNU Make Error Parser 6.0 (Deprecated)" to
"CDT GNU Make Error Parser 7.0" solves the problem but only until the project
file is generated again. The blog post http://www.jazzbee.com/blog/?p=76
suggests  changing "org.eclipse.cdt.core.MakeErrorParser" to
"org.eclipse.cdt.core.GmakeErrorParser" in cmExtraEclipseCDT4Generator.cxx.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-11-17 18:42 vitaut         New Issue                                    
======================================================================




More information about the cmake-developers mailing list