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
13
votes
1 answer

How to specify compiler flag to a single source file with qmake?

While other source files use the default flags? Some of my source files need some extra C++ preprocessor defines. I use Qt 5. I only found QMAKE_CXXFLAGS is for global use in qmake projects.
cetron
  • 166
  • 1
  • 8
13
votes
1 answer

How to mix Qt, C++ and Obj-C/Cocoa

I have a pure C++/Qt project on a Mac, but I now find that I need to call a few methods only available in the Cocoa API. Following instructions listed here: http://el-tramo.be/blog/mixing-cocoa-and-qt I have a C++ class implementation in a ".m"…
Thomi
  • 11,647
  • 13
  • 72
  • 110
13
votes
2 answers

Embedding Python3 in Qt 5

I would like to embed Python interpreter 3.4 into a Qt 5.2.1 application (64-bit). However I'm having build issues, I mean when I include Python header in the main.cpp it compiles fine. #include #include "mainwindow.h" #include…
krusty
  • 340
  • 3
  • 13
13
votes
5 answers

building with qmake on Linux - how to prevent qmake from linking to QtCore and QtGui

I have a shared library (with no QT dependency) [library B] that links to another shared library (with no QT dependence as well) [library A]. I am using Qmake and QT Creator 1.3. The problem is that when I build library B and run ldd on the…
Stick it to THE MAN
  • 5,621
  • 17
  • 77
  • 93
13
votes
2 answers

Qt - Using asterisk (*) in .pro-File with directories

I have a .pro file which looks like: SOURCES += myfolder/source1.cpp \ myfolder/source2.cpp HEADERS += myfolder/header1.h\ myfolder/header2.h FORMS += myfolder/form1.ui\ myfolder/form2.ui And everything works…
Matze Klein
  • 143
  • 1
  • 2
  • 6
13
votes
2 answers

Variables that persist across .pro files from a subdirs pro file

Greetings, I've got a .pro file that looks like: TEMPLATE = subdirs SUBDIRS = foo bar I want to set a variable, or define, or something in my subdirs .pro file that can be read in both the foo and bar .pro files. I've tried to set an environment…
Dan O
  • 4,323
  • 5
  • 29
  • 44
13
votes
2 answers

test if a variable is empty and give default value during qmake

How can you test if a variable is empty or not defined in a qmake .pro file? I want to be able to set up a default value if the variable is not defined. I tried eval("VARIABLE" = ""){ VARIABLE = test } eval("VARIABLE" = ""){ …
UmNyobe
  • 22,539
  • 9
  • 61
  • 90
13
votes
2 answers

QTCreator copy files to output directory with INSTALLS

I have two sub directories docroot and config in my Qt project. Files in these directories shall be copied to the build directory whenever I build / debug the project. As of https://stackoverflow.com/a/3991210/356726 this is possible by using…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
12
votes
2 answers

qmake : Build library without the symlinks and 'lib' prefix

I require a very simple mechanism in my application, where my project is built as a shared library '.so' or '.dll', but what I want is: ExampleAppOne.so I get: libExampleAppOne.so -> libExampleAppOne.so.1.0.0 libExampleAppOne.so.1 ->…
Rohan Prabhu
  • 7,180
  • 5
  • 37
  • 71
12
votes
4 answers

How to add custom targets in a qmake generated Makefile?

I use qmake to generate the Makefile, and that works well. However, sometimes I want to add more stuff to the generated Makefile without having to edit the generated Makefile. Let's say that we beside the source code have a Doxygen directory, and…
Johan
  • 20,067
  • 28
  • 92
  • 110
12
votes
1 answer

what do $$PWD and . mean in .pro in qt

I came across a lib missing problem in my app, it turns out that this might relate to my understanding of $$PWD and . in .pro file of qt project. So do $$PWD and . both mean the dir, which contains the .pro file OR the dir, which is generated by…
Henry
  • 2,819
  • 3
  • 18
  • 33
12
votes
1 answer

Using CMake with Qt5 and Qt Plugins

I'd like to avoid using qmake and .pro files. The problem is that I cannot get cmake to work nicely with Qt Plugins. I've included the code below showing the interface, plugin, loader that work correctly for the given .pro file but I cannot figure…
davepmiller
  • 2,620
  • 3
  • 33
  • 61
12
votes
1 answer

To what command in the Makefile does "Sysroot" from QtCreator transfer?

I'm cross compiling using Qmake and QtCreator. In the settings for the Kits (toolchain and qmake details are set there) there is a field called Sysroot:. (Example here) Since QtCreator and Qmake are, at the end, responsible for generating a…
TheMeaningfulEngineer
  • 15,679
  • 27
  • 85
  • 143
12
votes
2 answers

qmake: how to supply multiple variables via command-line?

qmake allows to supply a variables via a command-line interface like this: qmake "CONFIG += release" "MY_VAR = hello" So i can use $$MY_VAR inside a .pro file. But is it possible to suply more than one variable such way? I have tried qmake "CONFIG…
grigoryvp
  • 40,413
  • 64
  • 174
  • 277
12
votes
2 answers

Why disable specific warning not working in Visual Studio

With Visual Studio C++ 2013, I have a lot of warning C4100: unreferenced formal parameter, and I want to disable that. I added 4100 to the "Disable Specific Warnings" in the project for both Debug|Release configurations but unfortunately VS still…
Vincent
  • 2,712
  • 5
  • 24
  • 27