Skip to content

Instructions_for_dev_setup_under_Windows

Paweł Salawa edited this page Apr 16, 2021 · 4 revisions

Initial project configuration in QtCreator

Let's assume that you have "SQLiteStudio3" project placed in C:\projects\sqlitestudio.

Open SQLiteStudio.pro file from the application source code (do it by right-clicking on the projects list area and selecting "Load Project", note that you need to have qmake projects plugin loaded in QtCreator). QtCreator will ask you to "configure" the project. There is only one important thing to do - define the build path (you need to expand the "Details"). Set it to the following (for both Debug and Release configurations):

C:\projects\sqlitestudio\output\build

Plugin projects

It's very similar to how it was for the main project. Just open plugin's *.pro file and setup the build path.

For Plugins aggregated plugins project it will be:

C:\projects\sqlitestudio\output\build\Plugins

For any external plugin that you want to compile (that is outside of Plugins project), it will be similar:

C:\projects\sqlitestudio\output\build\YourPluginName

and so on...

Qt dependencies

To run compiled binaries you can either:

  1. Add C:\projects\sqlitestudio\output\SQLiteStudio to PATH environment variable (and restart QtCreator if it was already running).

  2. Alternatively you can copy all dependency dll files into the sime directory where SQLiteStudio.exe will be created, that is to: C:\projects\sqlitestudio\output\SQLiteStudio. Files to be copied include:

    • All *.dll files from C:\projects\lib (this directory and its contents were described in Compiling application from sources)
    • Another set of files will be copied from your Qt installation directory (C:\Qt\x.x.x\mingwxx_32\bin). Files will be: Qt5Core.dll Qt5Cored.dll Qt5Guid.dll Qt5Gui.dll Qt5Networkd.dll Qt5Network.dll Qt5PrintSupportd.dll Qt5PrintSupport.dll Qt5Scriptd.dll Qt5Script.dll Qt5Svgd.dll Qt5Svg.dll Qt5Widgetsd.dll Qt5Widgets.dll Qt5Xmld.dll Qt5Xml.dll libgcc_s_dw2-1.dll libstdc++-6.dll libwinpthread-1.dll
    • Last set of files to be copied are Qt plugins. Thei are in C:\Qt\x.x.x\mingwxx_32\plugins.
      • Copy entire directory C:\Qt\x.x.x\mingwxx_32\plugins\iconengines to C:\projects\sqlitestudio\output\SQLiteStudio\iconengines
      • Then do the same for remaining plugin directories: imageformats, platforms, printsupport and styles (the last one is for more recent Qt versions, it was absent in older).

That's it!

Output executables and plugins will be placed in:

C:\projects\sqlitestudio\output\SQLiteStudio

You can compile project, then compile plugins (that's the dependency order), write some code and recompile it. n case of problems, ask on forum.

Optional steps

Multiple CPUs

If you have multiple CPU cores, you might want to use them for faster compilation. In QtCreator, in "Projects" mode there is a "make" step for build. Expand this step for details and add command line argument for it:

-j 4

The number reflects number of CPU cores that will be used.

Unit tests

Unit tests are disabled by default. If you want to enable that sub-project, ou need to go to "Projects" mode, find "qmake" additional arguments and add:

"DEFINES += tests"

After QtCreator refreshes new project settings (after couple of seconds) you should see unit tests as a Run targets.