I have been requested to post a guide about setting Eclipse IDE for Darktable, so here it is.
This guide assumes that you are already able to build Darktable from sources in Windows (through MSYS2) and/or Linux, by using the command line.
Some basic knowledge of Eclipse is also required.
If you want to contribute to Darktable project, normally you need to create your own fork of the project in GitHub.
We assume that Darktable sources are in
- (for Windows) C:\msys64\home\<username>\develop\darktable
- (for Linux) ~/develop/darktable
Step 1. Install Ecplise CDT from website
Step 2. From the Ecplise Marketplace, search and install the addon cmake4eclipse
Step 3. Import Darktable source code
In eclipse: File→ New → Project → C/C++ → C++ Project
In the dialog, choose “Linux GCC toolchain” and point to the source code folder. See below
Hit “Finish”
Step 4. Set Project Properties
Go to the properties of the newly created Eclipse project. For example in Project explorer window, right click on the project → Properties
Setup as follows (hit “Apply” at every step)
For Windows, in C/C++ Build → Cmake4eclipse → Host OS overrides → Windows, make sure the option “Buildscript generator (-G)” is set to “Unix Makefiles”.
For Linux it should be already set correctly.
In C/C++ Build → Settings → Binary Parsers:
- for Windows, select only “WE64 Windows Parser”
- for Linux, select only “GNU Elf Parser”
Hit “Apply and Close”
Step 5. Build the project
Eclipse should run CMake first and then make install, you can see the output in the appropriate console.
The initial build will give some errors related to failing build of user manual, that is not a problem.
Incremental builds shall not give errors.
Step 6. Create a run configuration
For Windows
For Linux, just omit the .exe
Now Eclipse should be able to run and debug Darktable.
Of course you can now customize Eclipse behaviour and appearance to your liking.
Known issues
- In general, building and debugging in Linux is much faster.
- I couldn’t find a way to run Darktable “in place”, without installing. This adds an extra step at every build, which is quite fast in Linux, but pretty slow in Windows, especially because CMake runs the fixup_bundle utility at the end of every install, which is slow. Preventing this requires commenting a couple of lines in CMakeFiles.txt. Happy to hear if someone finds a better way to run Darktable without installing.
- In Windows, when running GDB, the keyboard inputs respond very slow. This is a bug in Gtk+. To avoid it, it is needed to build a custom version of Gtk+, but I have never tried.
Feel free to comment / modify / improve.