Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. conditional include of .pri file Qt
Forum Updated to NodeBB v4.3 + New Features

conditional include of .pri file Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 2.6k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ruisebastiao
    wrote on last edited by
    #1

    In my pro I have this :

    contains ( CONFIG, USE_VISION ){
        message(With vision)
        include($$PWD/src/vision.pri)
    }
    

    message with vision is printed if only CONFIG+=USE_VISION is defined but $$PWD/src/vision.pri is allways included in the project, how can i conditionally include pri files?

    aha_1980A kshegunovK 2 Replies Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The code is functionally correct.

      How do you know it's always included ?

      If it's because Qt Creator shows the file, then it's unrelated to it's inclusion or not in your .pro file.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • R ruisebastiao

        In my pro I have this :

        contains ( CONFIG, USE_VISION ){
            message(With vision)
            include($$PWD/src/vision.pri)
        }
        

        message with vision is printed if only CONFIG+=USE_VISION is defined but $$PWD/src/vision.pri is allways included in the project, how can i conditionally include pri files?

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by aha_1980
        #3

        Hi @ruisebastiao

        If you create a bugreport and ask here, than its nice to cross link: QTCREATORBUG-21037

        Even better is to give people a bit time to respond before asking the same question on multiple channels.

        Thanks.

        Qt has to stay free or it will die.

        R 1 Reply Last reply
        0
        • R ruisebastiao

          In my pro I have this :

          contains ( CONFIG, USE_VISION ){
              message(With vision)
              include($$PWD/src/vision.pri)
          }
          

          message with vision is printed if only CONFIG+=USE_VISION is defined but $$PWD/src/vision.pri is allways included in the project, how can i conditionally include pri files?

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          Couldn't reproduce - works as expected for me with the qmake from Qt 5.10.1

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          1
          • aha_1980A aha_1980

            Hi @ruisebastiao

            If you create a bugreport and ask here, than its nice to cross link: QTCREATORBUG-21037

            Even better is to give people a bit time to respond before asking the same question on multiple channels.

            Thanks.

            R Offline
            R Offline
            ruisebastiao
            wrote on last edited by
            #5

            @aha_1980 what is the problem of using multiple channels?

            kshegunovK 1 Reply Last reply
            0
            • R ruisebastiao

              @aha_1980 what is the problem of using multiple channels?

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by
              #6

              @ruisebastiao said in conditional include of .pri file Qt:

              what is the problem of using multiple channels?

              Someone said there's a problem with using multiple channels? It was said that it's recommended, and quite simply polite, to give all the relevant information, including where and what people have already suggested. It is hardly productive to keep the involved parties in the dark, wouldn't you say?

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved