Questions tagged [qmake]

`qmake`, part of the Qt framework, is a tool for generating Makefiles and IDE project files.

qmake, part of the Qt framework, is a multi-platform tool for generating GNU Makefiles, Microsoft Visual Studio project files, and Apple XCode project files from a common .pro project file.

Among other features specific to the Qt framework, qmake automates the process of running moc on source files that contain the Q_OBJECT macro.

qmake manual can be found here for Qt 4.8 and here for Qt 5.

1860 questions
27
votes
6 answers

Compile a single file under CMake project?

I'm developing a C++ project which is going to be enclosed on a bigger one. I've seen that on the bigger project (is a Qt application and it's being generated from qmake) I am able to compile a single file from the linux command line, just entering…
pacorrop
  • 547
  • 1
  • 4
  • 10
26
votes
2 answers

Project ERROR: Unknown module(s) in QT: multimedia

I am trying to compile qGo, after installing qt5 git clone https://github.com/pzorin/qgo.git cd qgo qmake make sudo make install Right now the latest error is saying it can't find multimedia # make cd src/ && ( test -e Makefile ||…
john mangual
  • 7,718
  • 13
  • 56
  • 95
26
votes
4 answers

How can I use C++14 features when building qmake projects?

I'm currently using C++11 features in my Qt applications. However, I'd like to use some of the new C++14 features in my applications. To enable C++11 in a Qt application, one only needs to add one line in the qmake project file, namely: CONFIG +=…
Rickforce
  • 317
  • 1
  • 5
  • 9
26
votes
2 answers

Linking with a debug/release lib with qmake/Qt Creator

I am using Qt Creator and have a Qt GUI project that depends on a C++ static library project. I want to link the release version of the GUI app with the release build of the .lib and the debug release of the GUI app with the debug .lib. I have…
Rob
  • 76,700
  • 56
  • 158
  • 197
25
votes
1 answer

CXXFLAGS modification of Qt pro file?

Possible Duplicate: Configuring the GCC compiler switches in Qt, QtCreator, and QMake I would like to use -O1 instead of -O2 in my makefile (CFLAGS and CXXFLAGS) for my Linux build. My understanding of how these makefiles are generated based on…
Brian Stinar
  • 1,080
  • 1
  • 14
  • 32
24
votes
3 answers

Why does qmake put all object (.o) files to one directory?

Let's say I have a Qt application where I have two classes with the same name in two different namespaces: namespace namespace1 { class SomeClass; } namespace namespace2 { class SomeClass; } and I have a project directory structure…
Peter Sivák
  • 557
  • 7
  • 10
24
votes
2 answers

How do I specify input the QMake INSTALLS variable?

In my Qt project I'm trying to copy libraries as part of the build process. The goal is to have a ready made distribution after the build with all necessary dynamic libraries. This seems acheivable with the INSTALLS variable, but I find the…
Eirik M
  • 726
  • 1
  • 6
  • 12
24
votes
3 answers

In Qt, when should you use RESOURCES vs. DISTFILES vs. OTHER_FILES

Within the .pro file, things are straightforward if you're including header files (use HEADERS), C++ files (use SOURCES) and Objective-C / Objective-C++ files (use OBJECTIVE_SOURCES), but it is less clear to me how other file types should be…
Paul Masri-Stone
  • 2,843
  • 3
  • 29
  • 51
22
votes
4 answers

How to build qt out of source

I was searching a lot through Qt forums and Google for the last few days, but I could not find any obvious answer to this question. I found the -prefix option (not even documented on Windows) that can be supplied to configure to specify different…
user152508
  • 3,053
  • 8
  • 38
  • 58
21
votes
2 answers

How to include Qt's headers with -isystem (system headers) with qmake and qt5?

I compile my Qt5-based project with warnings enabled on g++: # project.pro file QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -Wconversion -Weffc++ When compiling, Qt produces lots of warnings (1000+ with just one simple widget), hiding the warnings…
Julien-L
  • 5,267
  • 3
  • 34
  • 51
21
votes
2 answers

Building multiple targets in Qt / Qmake

How could I specify multiple targets with different configurations in Qt? Is there a way to do it in one .pro file? For example, I would want to build the following 2 .pro files (without having to manually change the .pro file each…
Switch
  • 5,126
  • 12
  • 34
  • 40
21
votes
12 answers

INCLUDEPATH in qmake project file doesn't work

I've got a problem with include in a qmake project. In my .pro file I've got: INCLUDEPATH += "C:\OpenCV\build\include" and in my cpp : #include The compiler indicates an error: Cannot open include file: 'opencv\cv.h': No such file…
user2794529
  • 259
  • 1
  • 2
  • 6
20
votes
4 answers

How to execute shell command after compile finished from .pro in QT?

What changes must I make to the .pro file if I want to execute chmod command, execute the output binary file, or do some other operations.
camino
  • 10,085
  • 20
  • 64
  • 115
20
votes
2 answers

How to change qmake release flags for gcc? (Change -O2 to -Os)

With qmake you can quite easy change so you build a debug version, or a release version. Just modify the CONFIG var and the compile flags change. CONFIG += debug CONFIG += release When you use the debug you get -g and no optimization, and when…
Johan
  • 20,067
  • 28
  • 92
  • 110
20
votes
5 answers

QMAKE: QMAKESPEC has not been set

I have recently recompiled Qt so that I can use static instead of shared libraries. But now, when I try to compile my project, I get the following error: QMAKESPEC has not been set, so configuration cannot be deduced. It seems like a common…
ravil
  • 597
  • 2
  • 4
  • 18