Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Precompiled headers with CMake in Qt 6. How?
QtWS25 Last Chance

Precompiled headers with CMake in Qt 6. How?

Scheduled Pinned Locked Moved Solved Qt 6
9 Posts 4 Posters 2.0k Views
  • 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.
  • B Offline
    B Offline
    bogong
    wrote on last edited by
    #1

    Hello all!
    I am trying to find any info about using PCH (precompiled headers) in Qt 6. Is there any examples or manuals? Is there something special in case of using it with Qt?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      See this Qt blog as a starting point.

      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
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        So hard using an internet search engine?
        https://cmake.org/cmake/help/latest/command/target_precompile_headers.html

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        B 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          So hard using an internet search engine?
          https://cmake.org/cmake/help/latest/command/target_precompile_headers.html

          B Offline
          B Offline
          bogong
          wrote on last edited by
          #4

          @Christian-Ehrlicher I've been asking in case of using Qt 6 with CMake and documentation about it in Qt. Not about just C++ project with CMake. I know perfectly about CMake functionality.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @bogong said in Precompiled headers with CMake in Qt 6. How?:

            I've been asking in case of using Qt 6 with CMake and documentation about it in Qt.

            What should be different when using Qt or plain c++ here?

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            B 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @bogong said in Precompiled headers with CMake in Qt 6. How?:

              I've been asking in case of using Qt 6 with CMake and documentation about it in Qt.

              What should be different when using Qt or plain c++ here?

              B Offline
              B Offline
              bogong
              wrote on last edited by
              #6

              @Christian-Ehrlicher Have you really read the question? If you have nothing to reply why are you righting it? The question is about something special in Qt 6.0. everything is in my question.

              Christian EhrlicherC 1 Reply Last reply
              0
              • B bogong

                @Christian-Ehrlicher Have you really read the question? If you have nothing to reply why are you righting it? The question is about something special in Qt 6.0. everything is in my question.

                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by Christian Ehrlicher
                #7

                @bogong said in Precompiled headers with CMake in Qt 6. How?:

                The question is about something special in Qt 6.0. everything is in my question.

                You ask how to use precompile headers with Qt6 & cmake. I told you to use target_precompile_headers(). So what's wrong with this answer? What else do you want to know (but do not ask for)?

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                I 1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  @bogong said in Precompiled headers with CMake in Qt 6. How?:

                  The question is about something special in Qt 6.0. everything is in my question.

                  You ask how to use precompile headers with Qt6 & cmake. I told you to use target_precompile_headers(). So what's wrong with this answer? What else do you want to know (but do not ask for)?

                  I Offline
                  I Offline
                  IceMichael
                  wrote on last edited by
                  #8

                  @Christian-Ehrlicher No, he is absolutely right, you are not contributing anything here apart from Google users being annoyed about reading this argument. Lifetime champion or not, your are not being constructive. And your disrespectful tone makes it even worse.

                  To be explicit here: Interesting would be to see how we can a wellformed list of Qt header names that can be used to pass to the CMake function. (And please don't answer know how to generate the list manually, this is trivial, too, but are there shortcuts? Can this be automatised in <1min? These are the important questions)

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • I IceMichael

                    @Christian-Ehrlicher No, he is absolutely right, you are not contributing anything here apart from Google users being annoyed about reading this argument. Lifetime champion or not, your are not being constructive. And your disrespectful tone makes it even worse.

                    To be explicit here: Interesting would be to see how we can a wellformed list of Qt header names that can be used to pass to the CMake function. (And please don't answer know how to generate the list manually, this is trivial, too, but are there shortcuts? Can this be automatised in <1min? These are the important questions)

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @IceMichael said in Precompiled headers with CMake in Qt 6. How?:

                    Interesting would be to see how we can a wellformed list of Qt header names that can be used to pass to the CMake function

                    No since CMake don't know what headers you're using / you want to use. Even when you link against Qt::Widgets adding the <QtWidgets> header to the precompiled target may be wrong. Adding some important headers manually shouldn't be that big problem.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    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