Skip to content

CMake build system, Pure CLI target, MinGW support

Dmitry K requested to merge k1-801/OpenRGB:cmake into master

This MR is breaking the one feature per MR rule, but they kind of relied on one another. The MinGW support bit can be omitted, as I'm the only one who needs it for now, but I'd run some tests with it first as it might have better results. The basic idea is to replace QMake with CMake, exchanging the project file accordingly.

CMake allows three things to happen:

  1. The project file is no longer required to contain the entire list of .cpp's;
  2. The project file can now contain more than one build target, which was used to make a CLI target.
  3. The project can now be built without any portion of Qt installed, though it would only build the CLI executable.

To reduce the build time I also added a third target (currently named "drivers") - a static library containing all controller classes. It is also used to pull all common library dependencies without any duplication.

I was not able to test this under MSVC, so I had to add MinGW support - and I finally nailed it. It does have some requirements to the compiler itself (GCC 9+ with a working std::thread support, TDM GCC recommended; be aware that the freshest binary builds for Windows on MinGW-w64 website are GCC 8). I had to edit inpout32 a little bit and I made CMake rebuild it along with OpenRGB. Found some potential bugs in there, left them in. We can still just place a final build just like with all other libs, but where's the fun in that?

I don't yet know how to configure pipelines to use CMake, will be looking into that now, but local builds do work.

Edited by Dmitry K

Merge request reports