[CMake] Cmake + Eclipse with a team

David Erickson daviderickson at cs.stanford.edu
Sun Dec 8 03:30:04 EST 2013


On 12/8/2013 12:18 AM, David Erickson 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.

Actually I should follow this up, while the above allowed me to resolve 
all of the system includes, Eclipse does not seem to be discovering the 
includes from entries like "include_directories(...)", can anyone 
confirm that their Eclipse is picking this up automatically?  And/or 
where I should see these entries in the Eclipse project properties?  I 
can certainly manually add them, but I'd prefer not to.

Thanks,
David


More information about the CMake mailing list