[CMake] Cmake + Eclipse with a team

Michael Jackson mike.jackson at bluequartz.net
Sun Dec 8 19:34:04 EST 2013


On Dec 8, 2013, at 4:05 PM, David Erickson <daviderickson at cs.stanford.edu> wrote:

> On 12/8/2013 12:05 PM, Michael Jackson wrote:
>> On Dec 8, 2013, at 3:18 AM, David Erickson <daviderickson at cs.stanford.edu> wrote:
>> 
>>> On 12/5/2013 5:40 AM, Michael Jackson wrote:
>>>> I used to use Eclipse for coding with CMake and the what worked the best for me was the following (This assumes you are on Unix/Linux/OSX).
>>>> 
>>>> Start in "Project A". Create a directory "Build". Have CMake generate "Makefiles" using "Build" as the build directory.
>>>> 
>>>> Start up Eclipse. Create a new "Existing Makefile" project and during the setup of that project you need to adjust the build command to "make -C ${ProjDirPath}/Build VERBOSE=1" which tells Eclipse to run make but use your already created Build directory with your makefiles.
>>>> 
>>>> Then Eclipse will show you the complete "file system" of Project A, VCS works, builds work (inside AND outside of Eclipse). The only downside is you get .project/.cproject in your Project A directory which you can have VCS easily ignore with a few config files. The procedure is described on the CMake wiki here
>>>> 
>>>> http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial  Look for "Option 2". THere are screen shots to help you through the setup.
>>>> 
>>>> 
>>> Thanks Mike-
>>> I gave this a go and I can definitely build and see all my source, however Eclipse by default was very confused about where to find the source.  I read on the tutorial that when you run with VERBOSE=1 Eclipse should be capable of picking up all the include directories, however when I browse to Project Properties -> C/C++ General -> Paths and Symbols nothing was showing up, so pretty much everything in my source code was red.  I discovered to get this working you need to go to Project Properties -> C/C++ General -> Preprocessor Includes, and on the Providers tab enable "CDT GCC Build Output Parser" and "CDT GCC Built-in Compiler Settings". Afterward doing a clean/build, and re-index, and everything was resolving as expected.
>>> 
>>> Thanks!
>>> David
>>  If you put the VERBOSE=1 then Eclipse will parse the compile lines and automatically find the include directories. So you need to setup the project then try compiling at least once and Eclipse should find everything. I have never had a problem with it finding includes except for OS X Frameworks.
> 
> This is what I've done and it is not discovering paths/symbols properly.  A few questions for you:
> -When you created the Eclipse project did you pick a toolchain? IE GCC, or None?
> -Is there somewhere in your project settings that the discovered paths/symbols are being populated so you can see them?  If so, where?
> -Have you tried this with Eclipse Kepler?
> 
> I'd love to get this solved.
> 
> Thanks,
> David

Hmm. I have not used CDT in a few years now and it looks like something has changed. I tried Kepler and Helios neither of those automatically found the include paths. At some point in the past it used to work. There is a CDT-devel mailing list. You might try asking on there what happened to the feature. 

Sorry for the false information

mike jackson








More information about the CMake mailing list