[Interest] QMake contains and include

Jérôme Godbout godboutj at amotus.ca
Wed May 20 17:17:18 CEST 2020


Hi,
QMAKE question: anybody manage to use an include inside a contains(){} into QMake? the include is processed no matter what!?!
message("list: '$$AMOTUS_SUBREPOS_OPTIONAL_NAMES' ")
contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n){
    message("Using i18n...")
    HEADERS += $$AMOTUS_Qt_PATH/i18n.h
    SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
    include(i18n.pri)
}contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, Amotus_Qt_Network){
    message("Using Amotus_Qt_Network...")
    include(Amotus_Qt_Network.pri)
}
If I put AMOTUS_SUBREPOS_OPTIONAL_NAMES = i18n
The message print:
Project MESSAGE: list: 'i18n'
Project MESSAGE: Using i18n...
The message is correct. But I get both the i18n.pri and the Amotus_Qt_Network.pri include anyway!? if I remove the i18n entry from the variable AMOTUS_SUBREPOS_OPTIONAL_NAMES =
I get the following:
Project MESSAGE: list: ''
The include for i18n.pri and Amotus_Qt_Network.pri are still included, but the i18n.h and i18n.cpp are grey out which seem to work for HEADERS and SOURCES but not include!?! is include special or parsed without any consideration of the scope?! I did try to close QtCreator and reopen without luck (using QtCreator 4.12.0 on Mac OS)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200520/dd537186/attachment.html>


More information about the Interest mailing list