qmake

Xcopy files to the new directory in pro/pri file

笑着哭i 提交于 2019-11-29 15:43:07
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 += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp win32 { QMAKE_POST_LINK += $$quote(cmd

Add opencv library to every qt project

核能气质少年 提交于 2019-11-29 15:23:25
suppose that we want to link OpenCV library with Qt ,in common, we add INCLUDEPATH and LIBS in qmake(.pro file) but if you are a machine vision engineer then most of your projects have to include OpenCV library, so is there any way to add opencv library in time of creating project. I use below command to add OpenCV library for my projects every time. INCLUDEPATH += -I/usr/local/include/opencv LIBS += -L/usr/local/lib -lopencv_stitching -lopencv_superres ...and another libraries my OS is ubuntu 16.04.3 1) You can create a .prf (project feature) file in your mkspecs/features directory: /usr

Is there a possibility to pass includes via -isystem when using qmake

試著忘記壹切 提交于 2019-11-29 14:16:37
问题 I use qmake as a makefile builder and want to stick to it. Further I would like to use "gcc -Wall -Werror -Wundef -Wextra" to get robust code. I'm thinking about "-pedantic" but that's further up the road. My main problem at the moment are the tons of warnings generated by libraries like boost, parts of qt and the like. At the moment I use pragmas whenever I include warning-generating headers #pragma GCC diagnostic ignored "-Wall" #include <QtGui> ... #include <QWidget> #pragma GCC diagnostic

How to add external libraries to qt4 application c++

隐身守侯 提交于 2019-11-29 13:49:55
问题 what is the best way to add additional compiled libraries to my qt project ? For example boost or poco libs ? Thanks :) 回答1: If you're using the GCC compiler add something like this to the .pro file: For Boost: INCLUDEPATH += d:/Biblioteki/C++/boost/boost_1_44_0a LIBPATH += d:/Biblioteki/C++/boost/boost_1_44_0a/stage/lib LIBS += -lboost_system-mgw44-mt-d-1_44 LIBS += -lboost_filesystem-mgw44-mt-d-1_44 LIBS += -lboost_date_time-mgw44-mt-d-1_44 For Poco: INCLUDEPATH += d:/Biblioteki/C++/Poco

Qt. Automatically adding version for application

﹥>﹥吖頭↗ 提交于 2019-11-29 13:19:04
问题 In a .pro file, I can set version of application such: VERSION = <some version> Is there a way of doing this automatically (e.g. getting the value from Mercurial)? 回答1: If you can get the version from a shell command, you can assign it to the variable with the $$system qmake function. So, for mercurial, you could try: # if the version tag is <major version>.<minor version> VERSION = $$system(hg parents --template '{latesttag}.{latesttagdistance}') # or if you fill all 3 positions manually:

How to suppress warnings for file included from header

好久不见. 提交于 2019-11-29 10:45:59
I use GCC -Weffc++ option in my Qt project. To suppress warnings from Qt headers i add QMAKE_CXXFLAGS += -isystem $(QTDIR)\include . But this doesn't suppress all warnings, i still get annoying warnings from QUuid class because $(QTDIR)\include\QtCore\quuid.h file includes ..\..\src\corelib\plugin\quuid.h . I tried to add QMAKE_CXXFLAGS += -isystem $(QTDIR)\src and QMAKE_CXXFLAGS += -isystem $(QTDIR)\src\corelib\plugin but it didn't help. Is there a way to fix this? dismine You need to suppress each directory separately. Example from my project: QMAKE_CXXFLAGS += -isystem "$$[QT_INSTALL

How to add specific flags to moc in a qmake project?

依然范特西╮ 提交于 2019-11-29 10:02:55
I compile a Qt executable using qmake && make on the following project.pro file: INCLUDEPATH *= ../../dependencies/boost QT *= opengl xml CONFIG *= qt opengl static TARGET = myexe HEADERS = Viewer.hpp MainWindow.hpp Inspector.hpp SOURCES = main.cpp Viewer.cpp MainWindow.cpp Inspector.cpp However, when compiling, moc chokes on a boost macro which it cannot parse. To work around this bug , I need to pass the flag -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED to moc, but I cannot manage to do so. How to I edit my .pro file to pass a given flag to moc ? (but not to g++ , as QMAKE_CXXFLAGS does) A bit

Why does qmake put all object (.o) files to one directory?

随声附和 提交于 2019-11-29 09:05:53
Let's say I have a Qt application where I have two classes with the same name in two different namespaces: namespace namespace1 { class SomeClass; } namespace namespace2 { class SomeClass; } and I have a project directory structure according to it: -->src/ -->namespace1/ -->someclass.cpp -->namespace2/ -->someclass.cpp When I compile the application with qmake, it puts all object (.o) files to one directory - so it creates someclass.o file first and then it rewrites it with the second someclass.o - which is a name collision so it is bad. Why does qmake not take into account the directory

How to refer to the source directory in qmake?

安稳与你 提交于 2019-11-29 09:01:39
问题 I added version.target = version.h version.commands = bash generate-version.sh QMAKE_EXTRA_TARGETS += version PRE_TARGETDEPS += version.h to the project, but it attempts to run "generate-version.sh" in destination directory: make: Leaving directory `.../qqq-build-desktop' make: Entering directory `.../qqq-build-desktop' Makefile:236: warning: overriding commands for target `version.h' Makefile:233: warning: ignoring old commands for target `version.h' bash generate-version.sh bash: generate

Create dir & Copy files with qmake

不问归期 提交于 2019-11-29 07:44:23
I am trying to copy target binary file in multiple folders. In first step I must create those multiple folders. I have followed this example without success. The only thing that worked was system(mkdir $$OUT_PWD/newFolder) , but I'm trying to use QMAKE_EXTRA_TARGETS for $(MKDIR) followed by $(COPY) from this example . Using Qt 4.8.6 with qmake 2.01a. This is how I run qmake: qmake Server.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug Update: This is my current implementation, which creates a list of directories and copies the target binary to selected directories. # List all