qmake

Getting QMake to generate a proper .app

Hi 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 fi...

Identifier for win64 configuration in Qmake

Is there a "win64" identifier in Qmake project files? Qt Qmake advanced documentation does not mention other than unix / macx / win32. So far I've tried using: win32:message("using win32") win64:message("using win64") amd64:message("using amd64") The result is always "using win32". Must I use a separate project-file for x32 and x64 ...

QMAKESPEC environment variable setting problem

refer to this post compile a xcode project in command line http://stackoverflow.com/questions/377992/building-xcode-projects-from-the-command-line the QMAKESPEC variable was unable to set to macx-g++. i was doing like this in terminal QMAKESPEC=macx-g++ but this still not able to generate a make file of my xcode project for me, so what i...

How to compile a simple Qt and c++ application using g++ on mac os x?

I am trying to use Qt for a project in school but am running into problems. I started following the tutorials and I am running into Makefile problems. Most of the tutorials say to run qmake -project, then qmake and finally make. But when I try this I run into the error make: *** No targets specified and no makefile found. Stop. I dont k...

How should I structure my Qt based project so as to have a clean qmake generated xcode project?

If I add sources and headers in my .pro file that arn't in the same directory, the resulting xcode project groups the files by it's default Sources, Headers, etc. but then puts the files in a subdir of those folders indicating the subdirectory where the files are. This make non-flat projects look exceedingly ugly when generated for xcode...

How do I link a dynamic library with qmake into my app?

In my qmake .pro file I add my desired dynamic library to LIB which allows for compilation but doesn't link to the library in the compiled application (i.e. I get a library not found error at run time). The problem is that I have the library in my build directory, not in the system directory (i.e. /usr/lib). But, I want to generate a OS...

Conditionally disable warnings with qmake/gcc?

Hello, I am involved with a software project written in Qt and built with qmake and gcc on Linux. We have to link to a third-party library that is of fairly low quality and spews tons of warnings. I would like to use -W -Wall on our source code, but pass -w to the nasty third-party library to keep the console free of noise and clutter...

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

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? ...

Finding compiler vendor / version using qmake

Is there any way to get the version and vendor of the compiler used by the user through qmake? What I need is to disable building some targets of my project when g++ 3.x is used and enable them when g++ 4.x is used. Any ideas are welcome. Update: Most answers targeted the preprocessor. This is something that I want to avoid. I don't wan...

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

Hi, 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 th...

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

Hi, 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 ...

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

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 n...

In Windows, What Makes qmake Append a "d" to a Debug Target?

I'm using a provided .pro file and for some reason, it's configured so that the debug libraries do not have "d" appended to their library name. What causes this and how do I restore it? E.g. QtGui4.dll (release) and QtGuid4.dll (debug) Thanks. ...

QtCreator project with multiple libs and one exe.

Like I said in a previous question, I'm planning on porting a Qt project from VC++ to QtCreator. The project consists of 4 subprojects: 3 of them are libs and the last one makes the exe. The subprojects are layered, meaning that each layer has compile and link time dependencies to the layers beneath it. The files are organized as follo...

How to force qmake not to create symbolic links to target when TEMPLATE=lib ?

I have a (partial) qmake project file like this: TEMPLATE=lib TARGET=whatever SOURCES=whatever.cpp HEADERS=whatever.h This will - atleast by default - create a library and few symbolic links like this: libwhatever.so -> libwhatever.so.0.1.0 libwhatever.so.0 -> libwhatever.so.0.1.0 libwhatever.so.0.1 -> libwhatever.so.0.1.0 libwhateve...

How do I set the executable attributes with qmake for a c++ project?

I use buildbot to compile my Qt/C++/nmake project. I would like to add the version number to the executable and the company details (on the properties of the file). Does anybody know where I can set this information? Note: I am using buildbot not Visual Studio so I need a command line way of doing this. ...

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

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 followi...

QMake 'subdirs' template - executing a target?

I am putting together a build system for my Qt app using a qmake .pro file that uses the 'subdirs' template. This works fine, and allows me to specify the order that each target is built, so dependencies work nicely. However, I have now added a tool to the project that generates a version number (containing the build date, SVN revision...

How to create a subdirectory for a project in qt-creator?

I would like to divide my qt project into several directories, because it is growing pretty large. However, when I click in browser in qt-creator, there is no 'Add directory' and no such thing in 'Add new'. Can this be done somehow? ...

Including a library in Qt, why isn't this working?

This seems like it should be really simple. I compiled a library in Qt (this newmat library), and produced the file libnewmat.a. Now I need to integrate this library into another project but I just can't get it to work. I've tried a few different things with the LIBS variable in my .pro file including: Win32:LIBS += libnewmat.a #libr...