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. building qt from sources - CMake Error at cmake/FindQt5.cmake
Forum Updated to NodeBB v4.3 + New Features

building qt from sources - CMake Error at cmake/FindQt5.cmake

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 4 Posters 3.2k 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.
  • G Offline
    G Offline
    GALAV
    wrote on 18 Jul 2022, 08:56 last edited by
    #1

    Hey all, I have encountered the aforementioned error.
    with the following being executed :
    b995d132-dd98-466a-be0a-0b27c38a0e9b-image.png

    any hints or clues will be welcomed :)

    J 1 Reply Last reply 18 Jul 2022, 09:01
    0
    • G GALAV
      18 Jul 2022, 08:56

      Hey all, I have encountered the aforementioned error.
      with the following being executed :
      b995d132-dd98-466a-be0a-0b27c38a0e9b-image.png

      any hints or clues will be welcomed :)

      J Offline
      J Offline
      JonB
      wrote on 18 Jul 2022, 09:01 last edited by
      #2

      @GALAV
      Are you attempting to build Qt5 or Qt6?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GALAV
        wrote on 18 Jul 2022, 09:09 last edited by GALAV
        #3

        @JonB
        QT6, but it seems like it requires QT5 for doing so, therefore the prefix_path to qt5 i guess

        J 1 Reply Last reply 18 Jul 2022, 09:15
        0
        • G GALAV
          18 Jul 2022, 09:09

          @JonB
          QT6, but it seems like it requires QT5 for doing so, therefore the prefix_path to qt5 i guess

          J Offline
          J Offline
          JonB
          wrote on 18 Jul 2022, 09:15 last edited by JonB
          #4

          @GALAV
          Then (not that I have done this but) presumably you should not have passed C:\Qt5.15.2\... to cmake. You should not have/use anything Qt5.x to build Qt6.x.

          G 1 Reply Last reply 18 Jul 2022, 09:19
          1
          • J JonB
            18 Jul 2022, 09:15

            @GALAV
            Then (not that I have done this but) presumably you should not have passed C:\Qt5.15.2\... to cmake. You should not have/use anything Qt5.x to build Qt6.x.

            G Offline
            G Offline
            GALAV
            wrote on 18 Jul 2022, 09:19 last edited by
            #5

            @JonB
            It makes sense what you are saying but this is the output with C:\Qt*6.3.1*...

            0e6cca2d-dea9-4d7f-b956-dcedabb372e3-image.png

            therefore im baffled and i guess the path to 5.15.2 is needed

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kkoehne
              Moderators
              wrote on 18 Jul 2022, 09:24 last edited by
              #6

              First of all it seems like you're not trying to build Qt from sources, but Qt Creator.

              Try to change the CMAKE_PREFIX_PATH you set to C:\Qt\6.3.1\msvc2019_64 (leaving out the lib\cmake\Qt6part).

              Director R&D, The Qt Company

              J 1 Reply Last reply 18 Jul 2022, 09:26
              0
              • K kkoehne
                18 Jul 2022, 09:24

                First of all it seems like you're not trying to build Qt from sources, but Qt Creator.

                Try to change the CMAKE_PREFIX_PATH you set to C:\Qt\6.3.1\msvc2019_64 (leaving out the lib\cmake\Qt6part).

                J Offline
                J Offline
                JonB
                wrote on 18 Jul 2022, 09:26 last edited by JonB
                #7

                @kkoehne
                I think OP has done that in latest post. OIC, without the extra stuff after that.

                @GALAV
                Again, only a guess, but which cmake are you using from the command line?
                [Just listen to @kkoehne, he will sort you out!]

                G 1 Reply Last reply 18 Jul 2022, 09:31
                0
                • J JonB
                  18 Jul 2022, 09:26

                  @kkoehne
                  I think OP has done that in latest post. OIC, without the extra stuff after that.

                  @GALAV
                  Again, only a guess, but which cmake are you using from the command line?
                  [Just listen to @kkoehne, he will sort you out!]

                  G Offline
                  G Offline
                  GALAV
                  wrote on 18 Jul 2022, 09:31 last edited by
                  #8

                  @JonB cmake version 3.24.0-rc3
                  @kkoehne - same output (tried both versions)

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kkoehne
                    Moderators
                    wrote on 18 Jul 2022, 09:39 last edited by
                    #9

                    Please delete the CMakeCache.txt file, and re-run. It seeems stuff was cached from a previous run.

                    Director R&D, The Qt Company

                    G 1 Reply Last reply 18 Jul 2022, 09:43
                    0
                    • K kkoehne
                      18 Jul 2022, 09:39

                      Please delete the CMakeCache.txt file, and re-run. It seeems stuff was cached from a previous run.

                      G Offline
                      G Offline
                      GALAV
                      wrote on 18 Jul 2022, 09:43 last edited by
                      #10

                      @kkoehne I meants same output after deleting the cache file.
                      :-)

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kkoehne
                        Moderators
                        wrote on 18 Jul 2022, 09:51 last edited by
                        #11

                        @GALAV , can you post the branch / version of Qt Creator that you are trying to build?

                        Director R&D, The Qt Company

                        G 1 Reply Last reply 18 Jul 2022, 09:55
                        0
                        • K kkoehne
                          18 Jul 2022, 09:51

                          @GALAV , can you post the branch / version of Qt Creator that you are trying to build?

                          G Offline
                          G Offline
                          GALAV
                          wrote on 18 Jul 2022, 09:55 last edited by GALAV
                          #12

                          @kkoehne
                          I cloned the highlighted URL
                          6e189885-fe71-4de9-920b-428d6f9b4589-image.png

                          then I executed in the folder:

                          git submodule update --init --recursive 
                          
                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            kkoehne
                            Moderators
                            wrote on 18 Jul 2022, 10:04 last edited by
                            #13

                            So master branch ...

                            I assume you have checked that C:\Qt\6.3.1\msvc2019_64 contains a valid Qt 6 installation?

                            Can you re-run cmake with --trace argument, log this to a file and upload the dump somewhere to inspect? E.g.

                            del CMakeCache.txt && cmake --trace -DCMAKE_BUILD_TYPE=Debug -G Ninja -DCMAKE_PREFIX_PATH=C:\Qt\6.3.1\msvc2019_64 C:\Users\Administrator\Desktop\QT-CREATOR-SRC >trace.log 2>&1

                            Director R&D, The Qt Company

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              GALAV
                              wrote on 18 Jul 2022, 10:23 last edited by
                              #14

                              thanks for providing the command.

                              it seems i don't have the privileges to attach a log file.

                              G 1 Reply Last reply 18 Jul 2022, 10:42
                              0
                              • G GALAV
                                18 Jul 2022, 10:23

                                thanks for providing the command.

                                it seems i don't have the privileges to attach a log file.

                                G Offline
                                G Offline
                                GALAV
                                wrote on 18 Jul 2022, 10:42 last edited by
                                #15

                                https://ctxt.io/2/AADgjVtcFw -- tracelog

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  kkoehne
                                  Moderators
                                  wrote on 18 Jul 2022, 11:45 last edited by
                                  #16

                                  CMake thinks the bitness of the Qt version does not match the bitness of the compiler. And indeed, it seems you're trying to build with the x86 compiler, but the Qt version you reference is 64bit.

                                  If you indeed want to build an x86 binary, you most likely have to build Qt yourself. The installer only offers 64 bit binaries by default.

                                  If choosing x86 was an accident, set up the build environment to 64 bit. For instance, launch cmd.exe and run

                                  "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64
                                  

                                  Director R&D, The Qt Company

                                  1 Reply Last reply
                                  1
                                  • G Offline
                                    G Offline
                                    GalHA
                                    wrote on 19 Jul 2022, 12:27 last edited by GalHA
                                    #17

                                    I am also running into the same error but on linux ubuntu 20.04
                                    88b2781f-0364-4fce-b47a-875a3748895c-image.png
                                    I have Qt 6.3.0 built and trying to build Qt Creator

                                    1 Reply Last reply
                                    0
                                    • K Offline
                                      K Offline
                                      kkoehne
                                      Moderators
                                      wrote on 19 Jul 2022, 13:32 last edited by
                                      #18

                                      @GalHA , Qt Creator master branch now expects Qt 6.2.

                                      https://lists.qt-project.org/pipermail/qt-creator/2022-July/009050.html

                                      So you need to install Qt 6.2 or newer.

                                      Director R&D, The Qt Company

                                      G 1 Reply Last reply 19 Jul 2022, 14:24
                                      0
                                      • K kkoehne
                                        19 Jul 2022, 13:32

                                        @GalHA , Qt Creator master branch now expects Qt 6.2.

                                        https://lists.qt-project.org/pipermail/qt-creator/2022-July/009050.html

                                        So you need to install Qt 6.2 or newer.

                                        G Offline
                                        G Offline
                                        GalHA
                                        wrote on 19 Jul 2022, 14:24 last edited by
                                        #19

                                        @kkoehne I have Qt 6.3.0 installed...

                                        1 Reply Last reply
                                        0
                                        • G Offline
                                          G Offline
                                          GALAV
                                          wrote on 20 Jul 2022, 07:44 last edited by
                                          #20

                                          @kkoehne
                                          this :

                                          "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64

                                          has fixed the problem for me, so thanks alot!
                                          and regarding @GalHA 's problem, maybe the equivalent to linux with gcc might help

                                          1 Reply Last reply
                                          0

                                          10/21

                                          18 Jul 2022, 09:43

                                          • Login

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