qmake

Qt: passing variables to subprojects

跟風遠走 提交于 2019-12-05 05:33:12
The structure of my project is as follow: Proj Proj.pro --subProj --subProj.pro ----subsubProj ----subsubProj.pro Is there a way i can instance a global variable in subProj.pro and call it en e.g. subsubProj.pro like: Proj.pro: GLOBAL_VAR = true subsubProj.pro: message($$GLOBAL_VAR) Update Maybe I should more precise with my problem. The usual behavior in Qt Creator when you right-click on Proj and choose "Build project"Proj"" is that qmake Proj.pro gets invoked then qmake subProj.pro and then subsubProj.pro What I want to achieve is: When i build the project "Proj" only Proj.pro and subProj

What are the merits of debug_and_release config feature in qmake?

余生颓废 提交于 2019-12-05 05:28:29
I can see only one merit of the feauture: we are able to issue the make all commad. Well, I do not call make in any point of my developer's life. I use Qt Creator and when I build the project I want it strictly as debug or as release. I guess this is an expeted behaviour by people. But debug_and_release is on by default in Qt Creator. Is there a merit in this I can't see? Is there some sense in the unintuitive mess like this: CONFIG( debug, debug|release ) { # debug } else { # release } which people are learning by making mistakes and asking WTF questions all over the internet? Am I missing

Get qmake to execute shell script after build finished on Mac

倖福魔咒の 提交于 2019-12-04 23:46:23
问题 After my release build is finished I would like to run a script. I found this question How to execute shell command after compile finished from .pro in QT? but the answer doesn't work for me. I tried adding various modifications of this to my .pro file: CONFIG(release, debug|release) { mytarget.target = ./MyScript.sh mytarget.commands = touch $$mytarget.target QMAKE_EXTRA_TARGETS +=mytarget QMAKE_POST_LINK += mytarget } But this always results with ":-1: error: mytarget: No such file or

How to get qmake to generate “project dependencies” in a Visual Studio .sln project

随声附和 提交于 2019-12-04 17:48:19
问题 I have a qmake build of a few libraries and an app which depends on them. Using the subdirs template I'm able to get qmake to output a .sln file which works almost to my liking in VC2008. Though I've specified the dependencies between the targets in every way I've seen described, I end up with no "project dependencies" in the .sln file, and I have to add these in manually. So far I've tried CONFIG += ordered with correct ordering to no avail. And similarly the more arcane syntax: client

How can I pass the output of a command as a compiler flag through a Qt project file?

好久不见. 提交于 2019-12-04 17:47:58
I'm trying to add the output of "git describe" to the about window of my application, so it's easier to find out what version of the application people use. I can do it by adding the following compiler flag: -DAPP_VERSION="$(git describe HEAD)" But since the project is based on qmake, I would like to find a way to put this into the Qt project file. Is this possible? And if so, how? edit: I tried adding the following: QMAKE_CXXFLAGS += -DAPP_VERSION="$(git describe HEAD)" But it just gave me "-DAPP_VERSION=", so I suppose I have to use some escape characters, but I don't know which ones and

qmake and QT_INSTALL_PREFIX. How can I select a new location for Qt library?

与世无争的帅哥 提交于 2019-12-04 16:11:18
问题 I am new to qmake and I am trying to build an existing application. Qt was originally installed in /usr/local/lib/Qt-4.3.5 and 'qmake -query QT_INSTALL_PREFIX' returns that path. I have moved the Qt library to another location and the generated Makefiles are peppered with the /usr/local original path. How can I force qmake to use the new location I selected without recompiling Qt? 回答1: This is a 'builtin' compiled into qmake from qconfig.cpp. The best way is to reconfigure Qt with another

Getting QMake to generate a proper .app

爷,独闯天下 提交于 2019-12-04 13:56:11
I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS. I can build in on MacOS using QMake just fine but I'm having trouble producing the final .app. It needs collecting all the third party frameworks and dynamic libraries, all the project's dynamic libraries and making sure the application finds them. I've read online about using install_name_tool but was wondering if there's a process to automate it.

Prepend/Append Makefile to a Qt generated Makefile

人走茶凉 提交于 2019-12-04 10:29:21
I have a building environment where I add some prepending and appending lines to each Makefile generated. It would be nice if I could put this lines into the qmake generated file via my project file ( .pro ). Of cause I can do this via some easy shell scripting but it would be much nicer to do it from inside of the project file. Is there any qmake command to use? Does anyone have any idea how to do this? Example: include $(ROOT)/prepend.mk $(LIB):$(OBJ) @echo ... include $(ROOT)/append.mk Customizing Makefile Output .pro file: QMAKE_EXTRA_TARGETS += extra_target extra_target.commands = @echo

How to create a vcproj with qmake such that its filters reflect the directory structure?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 09:53:57
I use qmake (Qt 4.5.1) to create my vcproj files. I would like to create customized filters for the output vcproj, such that not every *.h file ends up in the "Header Files" filter, *.cpp in "Source Files" etc. For example, a project containing the files foo\foo.h foo\foo.cpp bar\bar.h bar\bar.cpp should have a vcproj file with foo foo.h foo.cpp bar bar.h bar.cpp instead of Header Files bar.h bar.cpp Source Files bar.cpp foo.cpp Thanks! Krsna If you run qmake with CONFIG -= flat , you'll get the following project structure: Header Files foo foo.h bar bar.h Source Files foo foo.cpp bar bar.cpp

qt cross compilation for raspberry pi: Cannot find GLESv2

一个人想着一个人 提交于 2019-12-04 09:47:53
问题 I am trying to compile qt 5.9 for my raspberry pi 3 compute module and I have been following mainly the online guide here (https://wiki.qt.io/RaspberryPi2EGLFS). So, I have set the pi system roots to the mount point /mnt/pi-rootfs . I have also set the symlinks to be relative using the script sysroot-relativelinks.py . The qtbase configuration was called with the following argument: ./configure -opengl es2 -device linux-rpi3-g++ -device-option CROSS_COMPILE=/home/osboxes/Downloads/gcc-linaro