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
QtWS25 Last Chance

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.
  • GALAVG Offline
    GALAVG Offline
    GALAV
    wrote on 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 :)

    JonBJ 1 Reply Last reply
    0
    • GALAVG GALAV

      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 :)

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @GALAV
      Are you attempting to build Qt5 or Qt6?

      1 Reply Last reply
      0
      • GALAVG Offline
        GALAVG Offline
        GALAV
        wrote on 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

        JonBJ 1 Reply Last reply
        0
        • GALAVG GALAV

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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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.

          GALAVG 1 Reply Last reply
          1
          • JonBJ JonB

            @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.

            GALAVG Offline
            GALAVG Offline
            GALAV
            wrote on 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
            • kkoehneK Offline
              kkoehneK Offline
              kkoehne
              Moderators
              wrote on 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

              JonBJ 1 Reply Last reply
              0
              • kkoehneK kkoehne

                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).

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on 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!]

                GALAVG 1 Reply Last reply
                0
                • JonBJ JonB

                  @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!]

                  GALAVG Offline
                  GALAVG Offline
                  GALAV
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • kkoehneK Offline
                    kkoehneK Offline
                    kkoehne
                    Moderators
                    wrote on 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

                    GALAVG 1 Reply Last reply
                    0
                    • kkoehneK kkoehne

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

                      GALAVG Offline
                      GALAVG Offline
                      GALAV
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      0
                      • kkoehneK Offline
                        kkoehneK Offline
                        kkoehne
                        Moderators
                        wrote on 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

                        GALAVG 1 Reply Last reply
                        0
                        • kkoehneK kkoehne

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

                          GALAVG Offline
                          GALAVG Offline
                          GALAV
                          wrote on 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
                          • kkoehneK Offline
                            kkoehneK Offline
                            kkoehne
                            Moderators
                            wrote on 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
                            • GALAVG Offline
                              GALAVG Offline
                              GALAV
                              wrote on last edited by
                              #14

                              thanks for providing the command.

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

                              GALAVG 1 Reply Last reply
                              0
                              • GALAVG GALAV

                                thanks for providing the command.

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

                                GALAVG Offline
                                GALAVG Offline
                                GALAV
                                wrote on last edited by
                                #15

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

                                1 Reply Last reply
                                0
                                • kkoehneK Offline
                                  kkoehneK Offline
                                  kkoehne
                                  Moderators
                                  wrote on 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 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
                                    • kkoehneK Offline
                                      kkoehneK Offline
                                      kkoehne
                                      Moderators
                                      wrote on 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
                                      0
                                      • kkoehneK kkoehne

                                        @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 last edited by
                                        #19

                                        @kkoehne I have Qt 6.3.0 installed...

                                        1 Reply Last reply
                                        0
                                        • GALAVG Offline
                                          GALAVG Offline
                                          GALAV
                                          wrote on 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

                                          • Login

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