qmake

Qt project files and PREFIX variable

∥☆過路亽.° 提交于 2019-11-29 07:04:46
I included PREFIX = /usr/local inside my project file and then I run qmake myproject.pro The makefile doesn't say anything about PREFIX though so I assume that i'm doing something wrong. Any ideas? PREFIX doesn't mean anything in qmake files. The target for files is done via the target parameter. So if you want to make PREFIX determine the base location, such as /usr/local , you can do do something like this: isEmpty(PREFIX) { PREFIX = /usr/local } TARGET = myapp TARGET.path = $$PREFIX/ The isEmpty(PREFIX) will allow it to be changed during the command line call to qmake, e.g. qmake PREFIX=

qmake: How do I copy .dll/.so's to the output directory?

北城余情 提交于 2019-11-29 06:13:47
I have a Qt-project that builds a dll/shared-library and another Qt-project that tests the library. Is there any good way to have qmake copy the dll to the output-folder of the test-project? Add this to your pro file: target.path = ../testProject/$$TARGET INSTALLS += target # Copy the dynamic library. win32 { QMAKE_PRE_LINK=copy /Y lib\qextserialport\src\build\qextserialportd.dll debug\ & copy /Y lib\qextserialport\src\build\qextserialport.dll release\ } else { # TODO: Unices } This works, for the QextSerialPort library. Supports Qt's debug_and_release mode. QMAKE_POST_LINK also works, but

Eclipse, QT and “C++ project”: is it possible?

断了今生、忘了曾经 提交于 2019-11-29 04:29:27
Need your help: I want to use Eclipse CDT and QT without creating a "Qt gui project". Is it possible? How to include QT libraries to my C++ project, and how to call qmake/make to compile the program? This Similar question didn't help me( I want to use 'C++ project' instead of 'QT Gui project' because there is an issue with external libraries indexing in the QT project ( this problem ) Thank you a lot! Nikolai. Luca Carlon Doing this is quite bothering, I suggest you don't do it. I've tried it only on small projects. As far as I know you'll have to write a correct Makefile yourself (or setup

Unknown module(s) in QT: svg

*爱你&永不变心* 提交于 2019-11-29 02:50:00
Added QT += svg and I tried just QT += svg and greaterThan(QT_MAJOR_VERSION, 4): QT += svg to the .pro solution file and ran qmake from inside the QtCreator and got this error: error: Unknown module(s) in QT: svg Any ideas? You are lacking the installation of the the QtSvg library. Try to install them on your Ubuntu 13.10 in the following way: sudo apt-get install libqt5svg5* Debian Stretch: sudo apt install libqt5svg5-dev Fedora (courtesy of @robin-green): sudo dnf install qt5-qtsvg-devel 来源: https://stackoverflow.com/questions/21098805/unknown-modules-in-qt-svg

Where are variables such as $(MKDIR) and $(COPY_DIR) defined?

蓝咒 提交于 2019-11-29 01:57:25
I am trying to get hold of the values these variables contain but I couldn't find any informations about them on the web and searching for such strings in C:\Qt folder brought up nothing. Where are these variables defined ? Before a .pro file is processed and your Makefiles are generated by qmake several other files are pre-processed based on your compiler and platform. These files have the extension .prf and .conf and are loaded from a directory called mkspecs. The values of MKDIR and COPY_DIR variables in your Makefiles are generated by the values of QMAKE_MKDIR and QMAKE_COPY_DIR variables

Using QMAKE to build a both 32 and 64 bits versions of project

一世执手 提交于 2019-11-29 01:43:45
问题 I need to generate a 32 bits version of my application however I am compiling on a 64 bits OS. I'm looking for a way to make QMake to generate both 32 and 64 bits versions of my application. If this is not possible I would like to know how to switch to 32 bits. I would also like to avoid having to mess with the generated makefile. 回答1: Use a construction something like: CONFIG += 32bit CONFIG(32bit) { TARGET = 32bit_binary QMAKE_CXXFLAGS += -m32 LIBS += -L<path to 32bit libraries> } CONFIG

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

不问归期 提交于 2019-11-29 01:35:38
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" file. As a test, my "foo.m" file contains the following code (relevant #include methods have been stripped for clarity).: int foo::getMagicNumber() { NSCursor *cursor = [NSCursor new]; } Apparently, I need to add the .m file to a qmake variable called OBJECTIVE_SOURCES . My project .pro file looks like this: TARGET = testApp CONFIG += console CONFIG -=

Change Qt install path after building?

荒凉一梦 提交于 2019-11-29 00:16:41
how can I change Qt install path after I building it ? Example : qmake.exe search binaries to original install path, how can I change/redefine it ? Thanks. Edit : I finally found this patch to apply to Qt : http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatcher.7z http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatche_src.7z Fabio Zadrozny I was looking into this and found a way that works (in qt 4.7.2) by customizing qt with a qt.conf file. In my case, I added a qt4-4.7.2/bin/qt.conf (I think it must be in the same place as the qmake executable) With the following contents:

How do a specify a library file dependency for qmake in Qt?

ε祈祈猫儿з 提交于 2019-11-28 19:50:12
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET = SomeLib .. Then in a dependent SomeApp.pro: .. debug:LIBS += -lSomeLib_debug .. How can I force SomeApp to build if I touched SomeLib in qmake? It's ugly because you need to give the exact library file name, but this should work: TARGETDEPS += libfoo.a QT Creator will do the work if you click "Add library..." in the context menu of the project that should include the library. These variables are configured automatically for you: LIBS INCLUDEPATH DEPENDPATH PRE_TARGETDEPS See also http://doc.qt.digia.com/qtcreator-2

qmake: could not find a Qt installation of ''

自闭症网瘾萝莉.ら 提交于 2019-11-28 16:54:13
问题 I have a software in ubuntu that requires me to run qmake to generate the Makefile. However, running qmake gives back this error, qmake: could not find a Qt installation of '' I have installed what I thought to be the required packages using, sudo apt-get install qt4-qmake sudo apt-get install qt5-qmake But the error didn't go away. Any help on this would be gladly appreciated! 回答1: sudo apt-get install qt5-default works for me. $ aptitude show qt5-default tells that This package sets Qt 5 to