开发者

how to export headers using Qt pro files

I've a project with following files

TestP开发者_C百科roject/api/apiheader1.h
TestProject/api/apiheader2.h
TestProject/src/apiimplementaton.cpp
TestProject/inc/apiimplementation.h
TestProject/TestProject.pro

When the project TestProject.pro is built headers apiheader1.h, apiheader2.h needs to be copied to /usr/include/TestLib/. Is it possible to do this by specifying it in project file TestProject.pro.?

Any pointers / links will be helpful.


You can add this to the pro file... in qmake you can add extra targets...The copyheaders will get run once the target is built..

QMAKE_EXTRA_TARGETS += copyheaders  
POST_TARGETDEPS += copyheaders  

copyheaders.commands += mkdir -p /usr/include/TestlLib  
copyheaders.commands += cp -f PATH_TO_HEADERS/apiheader1.h /usr/include/TestLib  
copyheaders.commands += cp -f PATH_TO_HEADERS/apiheader2.h /usr/include/TestLib  


Are you sure that you want to move the files? Moving source files around feels wrong.

As for doing it using qmake, you can use the system() function to simply cp the files in question. http://pepper.troll.no/s60prereleases/doc/qmake-function-reference.html#system-command

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜