最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

qt - Create .pro and .pri Files to Access the Objects of Another Project - Stack Overflow

programmeradmin0浏览0评论

I'm working with a large set of projects of which some are executables and the other libraries.

For the libraries to create unit tests is "easy" as the library can be bound to the test project by linker. I'm searching for an acceptable way to use the .pro and/or the .pri files the include the object files into the testing project.

All projects must build and run in Windows as well as in Linux. The .pro files are used by qmake to generate makefiles and .vcxproj files respectively.

Upto now I tried to put the .obj files into .pri or .pro files:

    CONFIG(release, debug|release) {
      OBJECTS += $${TESTED_PROJECT_DIR}/release/obj/sample.obj
    } else {
      OBJECTS += $${TESTED_PROJECT_DIR}/debug/obj/sample.obj
    }

That produces makefiles, that look ok (containing the .objs) but there is nothing of them in the .vcxproj.

I also tried to generate a library additionally with the executables, that for now doesn't work as the library simply is put into vcxproj just as dependency.

发布评论

评论列表(0)

  1. 暂无评论