English 中文(简体)
Configuring variable DESTDIR in qmake
原标题:
  • 时间:2010-01-26 16:15:26
  •  标签:
  • build
  • qmake

I m using qmake for building a project of mine. I have been trying to set the DESTIR variable of qmake with a value that depend of the compiler used. Actually, I want that the binary of my project, after builded, be placed in a directory that has the name of the compiler used to build it.

Something like this... My current directory tree for my project is

- Project
| - src
| - include
| - bin
| |- binary_file

I wanted it to be like this

- Project
| - src
| - include
| - bin
| | - gcc-4.3.4
| | |- binary_file

Can I do this using qmake?

最佳回答

In the src/src.pro file, or wherever you set the DESTDIR

# compiler used
QMAKE_CXX = g++-4.3
# PROJECT_ROOT defined in .qmake.cache as $$PWD, in the Project root directory
DESTDIR = $$PROJECT_ROOT/bin/$$QMAKE_CXX/

If you don t want to set the compiler version, you can query it dynamically. I don t know if there is any general c++/qmake solution for it, but with g++ you can use -dumpversion:

CXX_VERSION = $$system($$QMAKE_CXX -dumpversion)
DESTDIR=$$PROJECT_ROOT/bin/$$QMAKE_CXX-$$CXX_VERSION/
问题回答

暂无回答




相关问题
Elegant way building url request with parameters

There must me a more elegant way to build a URL with parameters in .NET then for example Response.Write("<a href=HeadOfMarketView.aspx"+Session["HOM"] != null ? Session["HOM"]+">Head of Market&...

buildforge problem

when i tried to run the job i am getting the error saying that No server could be found matching all conditions please any one help me on this

您能否防止MSBuild.exe经营活动?

我用文字建造一些项目,偶尔利用习俗制造事件,给建筑系统造成了很大困难。 如果有可能,我想援引MSBuild.exe。

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Keyboard shortcut to build only startup project?

I ve tried to find a keyboard shortcut to build only the startup project In VS2008. I only found a configurable shortcut to build the project which is currently viewed, which isn t as good. Any ...

Dependency bundle (jar-files/sources/API docs) in Eclipse

I m developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I m ...

How to link to a static library in C?

I use code::blocks to compile my static library. The output result is a libstatic.a file. Now, how do I link to my library to use functions that were compiled? (I tried to use #include "libstatic.a"...

热门标签