Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [SOLVED] .pro-Files without HEADERS

    Tools
    3
    8
    1677
    Loading More Posts
    • 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.
    • A
      Asperamanca last edited by

      I was asked why we need to include the HEADERS into our .pro files. I should note that we do not use Creator as our primary IDE, we create the .pro-Files in order to use qmake for batch compilation.

      Is there any good reason other than the IDE to include the HEADERS? Will omitting them cause dependency problems? Would a .pro-File without HEADERS still open & compile in Creator (for those of us who occasionally use that IDE)?

      1 Reply Last reply Reply Quote 0
      • T
        tilsitt last edited by

        Hi,

        According to the "doc":http://doc.qt.digia.com/4.7/qmake-variable-reference.html#headers, the HEADERS variable is used by qmake to generate dependency information and detect if moc is required. So, yes, there are good reasons ;)

        1 Reply Last reply Reply Quote 0
        • A
          Asperamanca last edited by

          But shouldn't adding a DEPENDSPATH to the path where the headers are located do the same thing?

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            No, this tells qmake to check wether something has changed in these paths and rebuild if necessary

            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 Reply Quote 0
            • A
              Asperamanca last edited by

              If I understand you correctly, moc might not be run based on a header file change, even if the folder containing the header file is part of the DEPENDS_PATH.
              Right?

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Yes, qmake will take the files from HEADERS and parse them to know if moc needs to be run.

                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 Reply Quote 0
                • A
                  Asperamanca last edited by

                  Thanks!

                  (Note: Seems like a plain "Thanks" does not conform to some posting rule. So I add this rather pointless explanation)

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    You're welcome !
                    You might also want to set this thread as solved

                    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 Reply Quote 0
                    • First post
                      Last post