How can I build Qt projects using Bazel?

Viewed 513

I have a directory with Qt 5.15 for gcc_64 on Ubuntu. I know I need to link the proper .so (or .la?) file in the lib subdirectory and include the headers from the include directories. I would need to do this for several Qt modules. This is my second day using Linux and Bazel, and I'm not sure how to get a basic build setup going. I have tried using cc_import and cc_library so far without sucess.

I know everything is done automatically for you when using Qt Creator, but I am using Visual Sudio Code with a the Bazel build system for integration of other projects.

Here is a piece of the compiler input for a sample project when using Qt Creator.

g++ -c -pipe -g -Wall -Wextra -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../addressbook -I. -I/home/joseph/Qt/5.15.0/gcc_64/include -I/home/joseph/Qt/5.15.0/gcc_64/include/QtWidgets -I/home/joseph/Qt/5.15.0/gcc_64/include/QtGui -I/home/joseph/Qt/5.15.0/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I/home/joseph/Qt/5.15.0/gcc_64/mkspecs/linux-g++ -o addresswidget.o ../addressbook/addresswidget.cpp

I see macros, includes, and libraries added. What is all the other stuff?

An alternate route I have decided is to build a library out of a qt project and use that with Bazel. With this, how would I access GUI objects? Would I have signal and slots?

0 Answers
Related