views:

464

answers:

2

Hello!

I have a project that builds with CMake system, and I like to import it in Eclipse. However, when I generate eclipse project files with 'cmake -G "Eclipse CDT4 - Unix Makefiles"' there are no default include paths in Eclipse project(such as /usr/include' or the gcc path for standard headers).

How to fix that in most right way?

System: linux gcc 4.3.3 cmake 2.6.4 eclipse 3.5.1

+2  A: 

You have to go to the project properties (right button over the project), "C/C++ include paths and symbols" and add them here as "external include paths".

fnieto
The change should be done in CMakeList.txt, since Eclipse project files are generqated
dimba
I know, but only once. When CMakeList files change do not modify this settings into the Eclipse project. Adding standard headers to the eclipse project is only to allow the indexer to find them, but not related with the building process.
fnieto
fnieto is right, or at least what he says is the only solution I knew. As far as i know there is no better solution.
fco.javier.sanz
A: 

I think it's not releated to cmake, since the default include path /usr/include is part of compiler, while cmake -G "Eclipse CDT4 - Unix Makefiles" creates makefiles which execute cmake.

Check gcc spec file also.

dimba