I have a big project, I rely on the GNU machine, I want to add QT components, should I use qmake for everything now?

I have a large software project that uses aspects of OpenGL for visualization. I want to add a GUI and was thinking about using QT. Now, from what I understand, creating QT stuff can get ugly unless you use the qmake command ...

However, my project relies on GNU building tools (g ++, autoconf, automake, etc. etc.). Should I therefore restructure the entire build process to use qmake so that I can use several small aspects of QT? I am very reluctant to do this, given the size of the project.

As you might think, can I (somehow) use qmake for graphical components (i.e. qt-dependent stuff) and continue to use my standard GNU build process (make, g ++, etc.) for everything else?

Thanks Ben.

+3
source share
2 answers

After smoothing many times, I decided to compile the source code into a library using my original build process (but slightly modified to compile the library, not the binary), and then compile gui separately using qmake. Then it will also link gui to the source code of the library. Not 100% perfect, but works great. Probably the biggest hurdle was converting some glut code to QGLWidget ...

+1
source

Google AutoTroll howto.

Qt qmake, , ( ) Makefile. (QT4DIR, QTDIR Qt3), , Qt, -L$(QT4DIR)/lib -lQtCore -lQtGui .. LDFLAGS -I$(QT4DIR)/include/QtCore, -I$(QT4DIR)/include/QtGui .. CXXFLAGS. , , - autotools.

Edit:

MOC, , :

 moc_%.cc: %.h
     $(MOC) $< -o $@

, moc_*.cc SOURCES. , , QObject, .

+6

Source: https://habr.com/ru/post/1786731/


All Articles