1

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

2
  • I'm sorry not to understand your question... Commented Nov 24, 2015 at 11:59
  • Well, I'll try to reformulate Commented Nov 24, 2015 at 12:05

3 Answers 3

1

@Kopysov Evgeniy
requires(false) prevents the install target from running too! Header only libraries still need to be installed.

Sign up to request clarification or add additional context in comments.

1 Comment

Discovered by experimenting, that requires(false) does not work, but you need a TEMPLATE and a TARGET line
1

Comment system not working for me, so one needs the following lines:

TEMPLATE=lib LIB=dummy HEADERS=... headers.files=$$HEADERS headers.path=$$PREFIX/include INSTALLS+=headers 

Comments

0

In Headear-only library need use requires(false)

HEADERS += <your headers files> #needed in QtCreator for correct display "#include" directives INCLUDEPATH += <your deps> requires(false) #disable building 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.