Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QtCreator subdirs project

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?

like image 618
Dejwi Avatar asked Apr 26 '26 23:04

Dejwi


1 Answers

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

like image 186
akashrajkn Avatar answered May 04 '26 03:05

akashrajkn