-
Notifications
You must be signed in to change notification settings - Fork 37
Eclipse setup
Julian Valentin edited this page Mar 15, 2019
·
8 revisions
- Download and extract Eclipse IDE for C/C++ Developers from https://www.eclipse.org/downloads/eclipse-packages/
- Start eclipse executable
-
File->Import... Git->Projects from Git
-
Select "Clone URI"
-
Enter URI (SSH or HTPPS) and authetication details from this projects main page
-
Select branches to clone locally
-
Choose destination folder (preferably inside current workspace)
-
Wait for clone operation to finish, select "Import as general project" and finish
-
Rightclick newly created Project->New->Convert to a C/C++ Project (Adds C/C++ nature)
-
Select "Makefile project" and "Linux GCC" as toolchain
- Rightclick Project->Properties ->C/C++ General->Preprocessor Include Paths, Macros etc.->Providers (Tab)
- Select only CDT User Settings and CDT GCC Built-in Compiler Settings
- Move the latter to the top of the list
- Add "-std=c++11" to the "Command to get compiler specs" field
- Rightclick Project->Index->Rebuild
- Open the C/C++ Projects View
- Click on the small triangle ("View Menu") next to the minimize button of this view.
- Click "Filters..."
- Add filters
Either overwrite Eclipse build or install SConsolidator plugin
- Rightclick Project->C/C++ Build
- Deselect "Use default build command" and enter "scons"
- Switch to "Behaviour" tab
- Enter scons parameters (e.g: "-j4 SG_ALL=0 SG_BASE=1") in "Build (Incremental build)"
- Enter "-c" in Clean
- Optionally add different build configurations
- SConsolidator is an Eclipse plugin that Introduces native support for SCons scripts in Eclipse and provides nice features like dependency visualization
- Install SConsolidator from update page as proposed in Sconsolidator Wiki
- Restart Eclipse
- Right click on your Project > SCons > Use self-provided SCons build
- Add your desired SCons options e.g. ("SG_ALL=0 SG_BASE=1"). DO NOT specify parallel building. (e.g. "-j 4"). This is done automatically by SConsolidator.
- SConsolidator rebuilds the project
- Build will from now on automatically use Sconsolidator.
NOTE: Sometimes "Converting projects to SCons projects" hangs. I don't know why. Then use the above method overriding Eclipse build.
- CppStyle Eclipse Plugin: fixes the style of your C++ code and prevents style warnings/errors on jenkins
- Install CppStyle from Eclipse Marketplace
- Restart eclipse
- Rightclick Project->Preferences -> C/C++ -> CppStyle and set the corresponding
- clang format path to '' (/usr/bin/clang-format by default)
- cpplint path to "/tools/cpplint.py"
- Check "enable cpplint" and "run clang-format on file save"