在qmake中手动配置影子构建 [英] Manually configuring shadow build in qmake
问题描述
我非常喜欢qt Creator中的一个功能,它是Shadow版本.当Shadow Build启用时,所有生成的文件(* .moc,Makefile,*.o)都将在给定的源目录中生成,因此source目录保持干净.我正在从qt创建者转移到kdevelop,并且试图弄清楚此功能的工作原理,到目前为止,我可以使用变量DESTDIR
,OBJECTS_DIR
和MOC_DIR
,但是我无法在此目录中创建makefile.有什么想法吗?
There is a feature I really like in qt creator and it is the Shadow build. When the Shadow Build is on, all the generated files (*.moc, Makefile, *.o) will be generated in a given source directory, so the sources directory is kept clean. I am moving from qt creator to kdevelop and I am trying to figure out how this feature works, so far I can create the resulting binary, the moc files and object files to the extra directory using the variables DESTDIR
, OBJECTS_DIR
and MOC_DIR
but I cannot create the makefile in this diretory. Any ideas?
推荐答案
AFAIK QtCreator的功能基本上可以归结为:
AFAIK what QtCreator does, basically boils down to this:
mkdir my_shadow_build
cd my_shadow_build
qmake ../my_src_dir
这会在构建目录中创建Makefile本身,并简单地运行
this creates the Makefile itself in the build directory and simply running
make
使用原始目录中的源在build目录下创建所有临时文件.这不需要.pro文件中的任何特殊内容,而仅取决于从外部"的用法.
there creates all temporary files under the build directory, using the sources from the original directory. This does not require any special stuff in the .pro file but just depends on the usage "from the outside".
这篇关于在qmake中手动配置影子构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!