View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013823CMakeCMakepublic2012-12-30 15:472013-02-10 13:54
ReporterSirHase 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSLinuxOS VersionGentoo x86_64
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0013823: Auto-include Clang default include paths in Eclipse CDT
DescriptionWhen generating a new Eclipse CDT project using CMake with Clang compiler (/usr/bin/clang++), the project do not includes the default Clang include/preprocessors symbols list, as it does when I use gcc.

Without the preprocessor symbols and include paths, Eclipse reports a lot of false errors.

In Additional Information I talk about a solution, but may not be ideal because requires extra steps, and the user needs to manually include the projects compilation flags (-std=c++11 -stdlib=libc++).
Steps To Reproduce1) Create the first example from: http://www.cmake.org/cmake/help/cmake_tutorial.html [^]

2) Generate a Eclipse CDT project, specify native compiler to /usr/bin/clang and /usr/bin/clang++ for C and C++ respectively

3) Import this new project in Eclipse

4) Check the include paths, it should be empty
Additional InformationSoftware used:
Eclise IDE Version: Juno Service Release 1. Build id: 20121004-1855
Eclise CDT Version: 8.1.1.201209170703
Clang: 3.1 (branches/release_31) x86_64-pc-linux-gnu
--
Adding the include paths manually may not work because Eclipse can "forget" it after a restart.
--
Using Eclipse automatic path/symbols list discovery solution:
Setting the discovery command to: "/usr/bin/clang++ -E -P -v -dD ${plugin_state_location}/${specs_file} -std=c++11 -stdlib=libc++"(here I use C++11, so each environment will have it different, cant use CMake flags) then in "C/C++ Project Paths" -> "Path Containers" add paths/symbols with this discovery. This way, Eclipse preserves both CMake and default Clang includes/symbols.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032246)
Alex Neundorf (developer)
2013-02-10 13:54

I merged the EclipseDetectClangIncludeDirs into next.
This code was until now enabled for gcc and Intel, and now also for clang.

It seems to work for me.
Let me know if it doesn't for you.

 Issue History
Date Modified Username Field Change
2012-12-30 15:47 SirHase New Issue
2012-12-31 04:55 Alex Neundorf Assigned To => Alex Neundorf
2012-12-31 04:55 Alex Neundorf Status new => assigned
2013-02-10 13:54 Alex Neundorf Note Added: 0032246
2013-02-10 13:54 Alex Neundorf Status assigned => closed
2013-02-10 13:54 Alex Neundorf Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team