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.

1727 questions
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
  • 527
  • 7
  • 10
24
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
  • 277
  • 1
  • 3
  • 9
23
votes
1 answer

Build Qt Project in Debug Mode from Command line (aka bash script) in Linux

I already have a project with a .pro file that can be built in debug and release mode. So my question is what is the options on the commandline that I have to specify if I want to build my binaries with debug information. Here is an example building…
Matthew Hoggan
  • 6,723
  • 13
  • 63
  • 120
23
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,364
  • 1
  • 11
  • 31
22
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
  • 606
  • 1
  • 5
  • 11
21
votes
1 answer

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
  • 6,258
  • 10
  • 47
  • 85
21
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
  • 2,971
  • 8
  • 34
  • 56
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
  • 8,673
  • 19
  • 53
  • 94
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
  • 18,177
  • 25
  • 89
  • 107
20
votes
5 answers

How to compile a simple Qt and c++ application using g++ on mac os x?

I am trying to use Qt for a project in school but am running into problems. I started following the tutorials and I am running into Makefile problems. Most of the tutorials say to run qmake -project, then qmake and finally make. But when I try this…
Sam
  • 836
  • 2
  • 11
  • 20
20
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
  • 249
  • 1
  • 2
  • 6
19
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
  • 547
  • 1
  • 4
  • 18
19
votes
2 answers

How to put generated files (e.g. object files) into a separate folder when using Qt/qmake?

I have a Qt project that uses qmake. To improve clarity and readability, I'd like to keep the source files build system generated files (such as object files) separate. So my first step was putting the source files into a src/ sub…
vog
  • 18,135
  • 8
  • 51
  • 71
19
votes
2 answers

Getting values from pro files in Qt

I am using Qt 4.5 in Windows XP. My pro file has the variable VERSION = 1.0. Now i need to read this variable and get its value (1.0) from the source code. So that I don't have to maintain another variable for version inside my source code. I just…
liaK
  • 10,834
  • 10
  • 43
  • 70
19
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
  • 4,556
  • 11
  • 31
  • 38