I wanted to start tinkering with the source and see if I can fix some easy bugs.
The doc gives me everyone a basic idea what is needed to start compiling KiCad from source.
A good IDE helps out a lot while developing and debugging.
I wanted to document the way to set up a environment for beginners like me, that have a basic understanding of C++ and CMake but did probably not work with such a big project.
Please note that I am developing on linux.
There are a lot of different IDEs out there. I am used to Eclipse, but this mail and the general good reviews made me pick QTCreator as an IDE.
The start of everything is by downloading the sourcecode.
I will put everything into a folder in my home
git clone https://gitlab.com/kicad/code/kicad
Now we will create additional folders for the project file, the build folders and where the binarys are placed.
mkdir -p build/release/bin
mkdir -p build/debug/bin
After this we need to create our build configuration with CMake.
I will just show how it is done for a debug build.
For a good overview over the build-options you can view the CMakeLists and/or the Compile Option Symbols
I do not want to install the compiled program into my standard directories, so I will install them into build/debug/bin
cmake -DCMAKE_INSTALL_PREFIX=/path/to/KiCad/kicad/build/debug/bin/ -DCMAKE_BUILD_TYPE=Debug
Now a lot of missing dependencies will pop up.
To find out what packages you are missing, you have several options (at least under ubuntu):
apt search themissingpackagename
And now you have to look for the right package. You are generally looking for somithing like:
For other systems or for packages where you are not sure, just search the missing dependency and the name of your system and you will most likely see what is needed to install them.
After some time and installing you will have a successful make run.
Now you can open up QtCreator and follow the guide of the mail:
QtCreator > New > Import Project > Import Existing Project
Go to project KiCad > right click > add existing directory
sourcedirectory: /path/to/KiCad/kicad > Start Parsing > check checkbox
Now we can configure our build setting as we need them to be.
For this we go into the project tab.
(Sorry for the german, I think you get the basic idea nonetheless)
With this you should be able to comile, run and debug your code.
Just choose the configuration you just made with this button:
And click the hammer.
You should be able to open the compile window (bottom of the window, tab 4) and see how it is building.
There are a view things left I (currenttly) could not figure out.
E.g. the IDE does not resolve wx libraries, although it compiles them.
If anyone has an idea please let me know.
It should work in theory, at least according to: QtCreator External Lib
If anybody wants to add a guide for other IDEs, please post them here or link them.