|
|
**Download and install Eclipse**
|
|
|
|
|
|
* Download "Eclipse IDE for C/C++ Developers" from https://www.eclipse.org/downloads/packages/
|
|
|
* Extract to an arbitrary folder
|
|
|
* Open the terminal and navigate to the extracted folder
|
|
|
* Run eclipse by typing ./eclipse (note: before running the command to start eclipse you should have to be sure that AMDiS should be found automatically. This means that AMDiS can be found in the standard envionment variables such as PATH etc. For those who are using modules, just load the modules before typing the command.)
|
|
|
* Install the cmake4eclipse plugin: Go to Help -> Install New Software... -> Enter in "Work with" field: https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/ -> Enter -> Wait -> Mark CMake checkbox -> Next -> Next -> Accept licence -> Finish -> Click on "Install anyway"
|
|
|
* [OPTIONAL] Install BashEditor to get syntax highlightning for bash scripts: Go to https://marketplace.eclipse.org/content/bash-editor and follow the install instructions (drag an drop the "install" button to your running eclipse instance)
|
|
|
|
|
|
**Include a project into Eclipse**
|
|
|
|
|
|
Suppose you have a folder containing your project including the src/, init/ etc. folders, optimally as cloned git repository.
|
|
|
|
|
|
* Go to File -> New -> Project -> C/C++ -> C++ Project (Not C/C++ Project!!) -> Next -> Enter project name -> Uncheck "Use default location" -> Click on "Browse" and navigate to your existing project location -> Select "Linux GCC" -> Next -> Uncheck Debug -> Next -> Finish
|
|
|
* Right click on project -> Preferences:
|
|
|
** C/C++ Build -> In Tab "Builder Settings" make sure that "Generate Makefiles automatically" is checked -> Apply
|
|
|
** C/C++ Build -> Tool Chain Editor -> In field "Current Builder" select "CMake Make Builder (portable)" -> Apply
|
|
|
** C/C++ General -> Preprocessor Includes Paths, Macros etc. -> Click on tab "Providers" -> Scroll down and select both "CMAKE_EXPORT_COMPILE_COMMANDS ..." -> Apply
|
|
|
** C/C++ Build -> Click on Tab "Behavior" -> Check "Enable parallel build" -> Select your number of processors -> Apply and Close
|
|
|
* [OPTIONAL] Assign a shortcut to build the project: go to Window -> Preferences -> General -> Keys -> Scroll to "Build Project" and add "Strg + B" as Binding -> click on "Build All" and remove Binding -> Apply and Close
|
|
|
* Build project by typing "Strg + B" (or your personal shortcut) or right click on project -> Build project -> wait until finished
|
|
|
* The C++ Indexer will now run and this takes quit a while (see in the right lower corner for the status). After that all includes should be found.
|
|
|
* [OPTIONAL] enable formatter to have a unique format over the whole project:
|
|
|
** go to Window -> Preferences -> C/C++ -> Code Style -> Formatter -> Select "BSD/Allman [built-in]" from the trop down -> apply
|
|
|
** go to Window -> Preferences -> C/C++ -> Editor -> Save Actions -> Check "Format source code"
|
|
|
* [OPTIONAL] enable Git Perspective to get git support: Window -> Perspective -> Open Perspective -> Other... -> Click on Git -> Open (Then you are in the Git Perspective and you have a small icon on the right upper corner including "GIT" which can be used for the next times. To switch back to the C++ perspective, just click on the button with the C inside.) -> Click on Git Staging Tab -> Drag and drop all (or a subset) files from "Unstaged" to "Stagged Changes" (this mimics "git add") -> enter a commit message -> click on "Commit an Push..." |