How to check for the presence of an environment variable when building a project from qmake An environment variable may or may not be set. in qmake, it is necessary to analyze the availability and consequently build the project in different ways. The project is built under Windows and under Linux. I tried it even if the environment variable VAR_ENV is not declared anyway, says that it is not empty (it displays an empty string):
VAR=$$(VAR_ENV) !isEmpty (VAR) { message($$VAR) }