[CMake] Cmake + Eclipse with a team

David Erickson daviderickson at cs.stanford.edu
Sun Dec 8 03:18:19 EST 2013


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


More information about the CMake mailing list