Skip to content

Avoid unecessary warning message relative to PROJECTDEPLOYDIR not being defined before inclusion of templatelibconfig.pri #12

@jim-bcom

Description

@jim-bcom

PROBLEM
In our project we tend to often use default PROJECTDEPLOYDIR and thus we systematically get the folowing warning message:

:-1: warning: Project WARNING: PROJECTDEPLOYDIR may be defined before templatelibconfig.pri inclusion => Defaulting PROJECTDEPLOYDIR to /home/<username>/.remaken/packages/linux-gcc/<my defined INSTALLSUBDIR>/<my defined TARGET>/<my VERSION>. 

I reckon it serves a documentation purpose by easing the discoverability of this feature, but maybe we shouldn't get a warning for an expected behavior.

SUGGESTED SOLUTION
The code is here.

warning("PROJECTDEPLOYDIR may be defined before templatelibconfig.pri inclusion => Defaulting PROJECTDEPLOYDIR to $${PROJECTDEPLOYDIR}. ")
  • Keep this message for a more verbose mode
    For exemple by using remaken verboseMessage() enabled by CONFIG += verbose or QMake log(level, message) at info level, if such a thing exists? (and don't display warning:, but either nothing or smthing like note:).
    Thus the message could then always print the value to which the variable is set, and, if the variable is not set, add the bit explaining that the variable can be defined to override the default path.

  • If so, i'd suggest to do the same this with the previous message:

!defined(INSTALLSUBDIR,var) {
    message("INSTALLSUBDIR can be defined before templatelibconfig.pri inclusion. INSTALLSUBDIR is optional. Values can be : build (own build), thirdParties... A typical definition is INSTALLSUBDIR = build.")
}

Since we tend to define this variable in our .pro we don't see it, but instead of using message() here, it could only be a verbose message printing the variable value, and optionnally inform the user that it can override the default value if he wants to ?

  • Make the warning() a message(), like in the INSTALLSUBDIR (which could then stay like this).
    This would remove this message from the Issues windows of the IDE, and keep it clean for actual warnings.

-> Personnally I'm fine with the last solution: just make the warning a message like for INSTALLSUBDIR.

Thanks.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions