Question

I'm going to achieve the following hierarchy in my QtCreator project based on subdirs template:

Project:

  • subproject1 - static library
  • subproject2 - static library
  • subproject3 - unittests executable

The only one executable will be in subproject3, which will link against subproject1 and subproject 2.

However build works fine I've noticed some usability issue. When I run the whole project it tries to find executables in my libraries - and fails. I have to run subproject3 instead of the main one. Is it possible to avoid such situation?

No correct solution

OTHER TIPS

I am using a similar hierarchy for the unit-tests - and the .pro file should have the following lines in it

INCLUDEPATH += ../subproject1/ \
    ../subproject2/

After adding the folders in the INCLUDEPATH variable, you can add the sources and header that you need using the SOURCES and HEADERS variables. Hope it helps you

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top