Hekx Hekx - 6 months ago 33
C++ Question

Entering scopes in template lib

In a C++/Qt project, we are using .pro-files and qmake to build. Part of the project is a static lib. The .pro file goes like this:

CONFIG = staticlib

#general build instructions

#some os-specific build instructions
#some os-specific build instructions

However, these scopes are never entered, not on a linux system (when the first scope should execute), nor on a windows system (for the second scope).

This only appears to be a problem in the staticlib-configuration/lib-template.

The Qt-documentation mentions the different templates, but I do not see anything mentioned as to why scopes would not work or how to solve this.

kmm kmm

Those conditions are true if they're set in the CONFIG variable. By overwriting CONFIG with staticlib, you reset all preset flags, including the ones specifying the platform.

It should work if you do CONFIG += staticlib