qmake

How do I use qmake to build multiple binaries in a single project?

南笙酒味 提交于 2019-11-28 16:42:56
问题 I'm writing a small qt app suite that consists of a set of small programs that work on the same set of files. They are organized like this: / app1/ main.cpp app2/ main.cpp app3/ main.cpp common/ project.h project.cpp somemore.h somemore.cpp appsuite.pro When I do qmake && make , I want the following binaries to be built: app1/app1 app2/app2 app3/app3 How do I write appsuite.pro to work like this? I have heard something about .pri files, but I could not figure out how to use them in my

Qmake project dependencies (linked libraries)

余生颓废 提交于 2019-11-28 15:13:40
I have a project that links to a number of shared libraries. Lets say project A depends on projects B and C Ideally, I want to impose the following dependencies in my project file: Rebuild project A if either B or C has been rebuilt since last time project A was built Use the output for the relevant configuration (i.e. if building project A in debug mode, then use the debug versions of the libs for project B and C) Does anyone know how I may explicitly express such dependencies in my project file? After quite a bit of frustration with qmake, I have found what I think is the answer to your

Linker doesn't use a default runtime library when linking together libraries only (no objects)

荒凉一梦 提交于 2019-11-28 14:35:40
I want the users to be able to re-link my Qt-using application to their own build of Qt, without being forced to rebuild all of the sources. This could be used for LGPL compliance, for example. To do this, I need to provide object files for all of my sources. To make it easy, using qmake, I've partitioned the project internally into: A static library project that contains objects for all of the source files, including the file that has int main(int, char**) . An application project that links the static library above with Qt. Qt may be either a static library or dynamic. There are no source

Changing OpenSSL include path for qmake

☆樱花仙子☆ 提交于 2019-11-28 14:26:10
I want to build Dogecoin with qmake. It doesn't work with Fedora's OpenSSL because its OpenSSL doesn't have elliptic curve cryptography included. So I've got my own OpenSSL but I can't figure out how to change the dogecoin-qt.pro file to include an OpenSSL from a different location. Normally with make I would do this: $ export OPENSSL_INCLUDE_PATH="/usr/local/ssl/include" $ export OPENSSL_LIB_PATH="/usr/local/ssl/lib" qmake seems different, the file I need to change is here: https://github.com/dogecoin/dogecoin/blob/master/dogecoin-qt.pro How do I change it, or what arguments can I give to

INCLUDEPATH in qmake project file doesn't work

醉酒当歌 提交于 2019-11-28 10:48:28
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 <opencv\cv.h> The compiler indicates an error: Cannot open include file: 'opencv\cv.h': No such file or directory but if I write this in my cpp: #include "C:\OpenCV\build\include\opencv\cv.h" it works! I build the project from within Qt Creator. What am I doing wrong? You have to run qmake(build->run qmake) to validate changes in the pro file. Qt creator Adding external library (still: Cannot open include file: 'GL/glew.h') Kuba Ober Your problem may

Xcopy files to the new directory in pro/pri file

馋奶兔 提交于 2019-11-28 10:14:36
问题 how can I copy the entire directory with the contents to new path using pro file. I tried "xcopy /S /I /Y" but its not working. Can someone point the error I am doing BINARY_DESTINATION_PATH = $$PWD$$SEPARATOR/dd/ RESOURCE_SOURCE_PATH = $$PWD$$SEPARATOR/temp EXPORTED_DESTINATION_PATH = $${BINARY_DESTINATION_PATH} EXPORTED_DESTINATION_PATH ~= s,/,\\,g EXPORTED_SOURCE_PATH = $${RESOURCE_SOURCE_PATH} EXPORTED_SOURCE_PATH ~= s,/,\\,g QT += core QT -= gui CONFIG += c++11 TARGET = sample CONFIG +=

Linking libraries to a QT project using pkg-config output

只愿长相守 提交于 2019-11-28 08:09:50
This is a bit of a newbie question. I am trying to add the OpenCV libraries to a QT project. This question says the link flags are given by pkg-config --libs opencv If I paste the command line output into the project file like: LIBS += -L/usr/local/lib -lml -lcvaux -lhighgui -lcv -lcxcore then everything compiles fine, but now this isn't portable. How can I simply reference the output of the command? Update: Tried Ken Bloom's suggestion, but it won't compile. The actual generated compiler commands are # How it should be, at least on my machine g++ -o QOpenCVTest main.o qopencvtest.o moc

How to generate .sln/.vcproj using qmake

一笑奈何 提交于 2019-11-28 05:31:47
I have main.cpp in c:\test folder and do the following: qmake -project qmake -tp vc test.pro The answer is: WARNING: Unable to generate output for: C:/test//Makefile.Debug [TEMPLATE vcapp] WARNING: Unable to generate output for: C:/test//Makefile.Release [TEMPLATE vcapp] But, I don't need make files. I need .vcproj! Environment: Windows XP Pro SP3, MSVC 7.1 and 8.0. Qt is installed in C:\Qt\2010.02 (LGPL version). Commands are run from Qt Command Prompt. What's wrong with it? How to generate .sln/.vcproj? May I generate them for MSVC 7.1 and 8.0? Ayman try using this from Qt command prompt and

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

a 夏天 提交于 2019-11-28 05:22:26
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 found out how to add additional libraries to the project by including a line like the following in my .pro file: LIBS += -L./libfolder -lmylib.lib But I cannot see how I can use a different -L command for release and debug builds. Is there support in qmake to do this? Nick In your project file you can do something like this debug { LIBS += -L./libfolder

Why does Qt use its own make tool, qmake?

三世轮回 提交于 2019-11-28 04:37:54
I just started using Qt and noticed that it uses its own make tool, qmake . Why does Qt use its own make tool? Is there something special that prevents it from using a standard make tool? Does qmake call the GCC C++ compiler? Qt uses qmake to transparently support Qt's various addons, including "moc, the meta-object compiler" (which provides signals & slots), "uic, the ui compiler" (which creates header files from .ui designer files), "rcc, the resource compiler" (which compiles resources). There's nothing to stop you using any build system you want. however, it's a lot more work. For example,