qmake

QMake - how to copy a file to the output

柔情痞子 提交于 2019-11-26 05:23:43
问题 How can I copy a file from my project to the output directory with qmake? I\'m compiling on Linux but in the future I\'ll compile it on Mac and Windows. 回答1: Here's an example from one of our projects. It shows how to copy files to the DESTDIR for Windows and Linux. linux-g++{ #... EXTRA_BINFILES += \ $${THIRDPARTY_PATH}/gstreamer-0.10/linux/plugins/libgstrtp.so \ $${THIRDPARTY_PATH}/gstreamer-0.10/linux/plugins/libgstvideo4linux2.so for(FILE,EXTRA_BINFILES){ QMAKE_POST_LINK += $$quote(cp $$

How to specify different Debug/Release output directories in QMake .pro file

懵懂的女人 提交于 2019-11-26 04:59:32
问题 I have a Qt project and I would like to output compilation files outside the source tree. I currently have the following directory structure: / |_/build |_/mylib |_/include |_/src |_/resources Depending on the configuration (debug/release), I will like to output the resulting files inside the build directory under build/debug or build/release directories. How can I do that using a .pro file? 回答1: The short answer is: you don't . You should run qmake followed by make in whatever build

C++ Qt - How to add “-std=c++11” to the makefile which is generated by qmake?

一笑奈何 提交于 2019-11-26 04:47:12
问题 I\'m developing a program in Qt. Its makefile is generated automatically from the .pro file. I need to use some code which need the -std=c++11 flag to be set up for g++. Where in .pro should I add this flag? (changing only the Makefile won\'t work since it gets overwritten by the newly generated one, each time I build the project). 回答1: You may find it tempting to insert the specific flag (which you mention) QMAKE_CXXFLAGS += -std=c++11 in your .pro file, but this will insert just that flag