简体   繁体   English

用qmake生成具有MS VS附加依赖关系的makefile

[英]generate makefile with qmake that have additional dependency for MS VS

I have a Visual Studio project that is made with qmake (qmake -tp vc), it's a lib, and it uses win32 socket function (setsockopt), so I need include "Ws2_32.lib". 我有一个用qmake(qmake -tp vc)制作的Visual Studio项目,它是一个lib库,它使用win32套接字函数(setsockopt),因此我需要包含“ Ws2_32.lib”。

but if I do something like 但是如果我做类似的事情

POST_TARGETDEPS  += Ws2_32.lib

it's not written to Visual Studio project file. 它不会写入Visual Studio项目文件。 Problem for me, that I have few app type projects that includes this lib, and I would be better if I don't need set additional lines in .pro files for these projects. 我遇到的问题是,我很少有包含此lib的应用程序类型项目,如果不需要在.pro文件中为这些项目设置其他行,那会更好。

So my question is, what directive/variable I need to use in .pro file, so lib dependency ends in Visual Studio project files? 所以我的问题是,我需要在.pro文件中使用哪个指令/变量,所以lib依赖关系在Visual Studio项目文件中结束?

Solved: I didn't found how to create Visual Studio project file for lib with additional dependency, but as workaround I added LIB definition in .pri file which is included in all application type projects, so I don't need to add this lib to each project manually. 解决:我没有找到如何为具有额外依赖关系的lib创建Visual Studio项目文件的方法,但是作为解决方法,我在.pri文件中添加了LIB定义,该文件包含在所有应用程序类型项目中,因此我不需要添加此lib手动输入每个项目。

使用LIBS

win32:LIBS += -lWs2_32

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM