I create qmake project with "Subdirs" template, header library and testing console-application.
Main.pro:
TEMPLATE = subdirs CONFIG -= app_bundle CONFIG -= qt CONFIG += ordered SUBDIRS += tests Config Config.pro:
HEADERS += \ Reader.h \ Builder.h\ Store.h\ Setter.h tests.pro:
HEADERS += \ CheckConfig.h \ CheckReader.h \ JsonGenerator.h \ Setter.h SOURCES += \ CheckReader.cpp \ JsonGenerator.cpp \ main.cpp \ Setter.cpp #my util functions and vars include(../common/settings.pri) include(../common/common.pri) #generate application config ConsoleApplication(test) #enable flags for exports libs in depends.pri file EnableModuleExport() include(../Config/depends.pri) #setup includepath for Config library SetHeadersPath(../) qmake generate makefile for project Config.pro, after run build with gcc, I have error. That's okay, because I did not ask the build targets and no function main(). It is necessary to disable the generation of a Makefile for qmake, or generate a makefile without build targets.
I did the project Config as fake static library, but it is not the best solution