简体   繁体   English

Qmake Qt:将头文件移动到生成文件夹

[英]Qmake Qt: Move Header file to build folder

I'm new to Qt, with a C# background. 我是Qt的新手,具有C#背景。

I am creating Dym Libs for a few projects. 我正在为一些项目创建Dym Libs。 I want to have the Header files moved to the build folder during compile OR know how to include the Header file in the lib. 我想在编译过程中将Header文件移动到build文件夹, 或者知道如何在lib中包含Header文件。

Any suggestions on how to make my lib a full package without having to copy/paste the header files, or the best approach for distribution would be great. 关于如何使我的lib成为完整软件包而无需复制/粘贴头文件的任何建议,或者最好的分发方法都将是不错的选择。

Cheers 干杯

Use the INSTALLS qmake variable 使用INSTALLS qmake变量

public_headers.path = include
public_headers.files = include/*.h

INSTALLS += public_headers

Then you can call make install (with a proper prefix, see eg this question ), which should result in the headers being installed alongside the binaries. 然后,您可以调用make install (使用适当的前缀,请参见例如此问题 ),这将导致在二进制文件旁边安装标头。

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

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