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. QT 14.2 cmake: Cannot find Qt5Widgets et. al.

QT 14.2 cmake: Cannot find Qt5Widgets et. al.

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 2 Posters 5.2k Views 2 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.
  • sierdzioS sierdzio

    Cmake files are normally under <prefix>/lib/cmake

    A Offline
    A Offline
    Alec Leamas
    wrote on last edited by
    #3

    @sierdzio: thanks for input. This is a cross-compilation for android, so the cmake files goes into the local sysroot. I'm on Fedora, and certainly don't want to install these cmake files into the normal system-wide host locations.

    That said, this might be a diversion. The core issue as I understand it is that when doing find_package(Qt5Widgets REQUIRED) cmake looks for Qt5WidgetsConfig.cmake or FindQt5Widgets.cmake, and these files are just not installed anywhere by make install.

    A 1 Reply Last reply
    0
    • A Alec Leamas

      @sierdzio: thanks for input. This is a cross-compilation for android, so the cmake files goes into the local sysroot. I'm on Fedora, and certainly don't want to install these cmake files into the normal system-wide host locations.

      That said, this might be a diversion. The core issue as I understand it is that when doing find_package(Qt5Widgets REQUIRED) cmake looks for Qt5WidgetsConfig.cmake or FindQt5Widgets.cmake, and these files are just not installed anywhere by make install.

      A Offline
      A Offline
      Alec Leamas
      wrote on last edited by Alec Leamas
      #4

      hm... At a closer look, seems to be about configuration. If I run configure without the cross-compilation flags, just a normal build, the missing cmake files seems to be installed.

      So it boils down to convincing configure to produce the cmake files...

      So: rephrasing my question: Has anyone a clue about what configure requires to include the cmake support? Is it just disabled for cross-compilations?

      sierdzioS 1 Reply Last reply
      0
      • A Alec Leamas

        hm... At a closer look, seems to be about configuration. If I run configure without the cross-compilation flags, just a normal build, the missing cmake files seems to be installed.

        So it boils down to convincing configure to produce the cmake files...

        So: rephrasing my question: Has anyone a clue about what configure requires to include the cmake support? Is it just disabled for cross-compilations?

        sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #5

        @Alec-Leamas said in QT 14.2 cmake: Cannot find Qt5Widgets et. al.:

        So it boils down to convincing configure to produce the cmake files...

        I think you're right. I've checked the Android build made by Qt Company - it does contain cmake files in lib/cmake, same as desktop builds do. So:

        So: rephrasing my question: Has anyone a clue about what configure requires to include the cmake support? Is it just disabled for cross-compilations?

        It's not disabled if official packages contain it. It must be some configure quirk... unfortunately I don't know what it is, sorry.

        I'll try a manual build on my side and report results (if they will be interesting).

        (Z(:^

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #6

          I think my NDK is too new, it fails every time I try to compile. :-/ Sorry, that's it from me, I don't have time to try it more. I have compared your configure flags with mine and they look OK.

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Alec Leamas
            wrote on last edited by Alec Leamas
            #7

            Thanks for your efforts!

            For now, I 'll probably need to hack some FindQtXXX.cmake files myself from scratch. Boring, but shouldn't be that complicated (at least as long as I stay away from the COMPONENTS stuff...)

            EDIT: BTW: I'm using the latest ndk (21), no problems besides the one described her.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #8

              I think you can just take cmake files from prebuilt Qt, they may need a slight modification to trim the number of ABIs but apart from that they should work I think.

              (Z(:^

              A 1 Reply Last reply
              0
              • sierdzioS sierdzio

                I think you can just take cmake files from prebuilt Qt, they may need a slight modification to trim the number of ABIs but apart from that they should work I think.

                A Offline
                A Offline
                Alec Leamas
                wrote on last edited by Alec Leamas
                #9

                @sierdzio It's not as simple as 'cmake files'. In particular, is the FindQt5Widgets.cmake and friends there? I also get a bunch of cmake files, but many important ones like this is missing.

                Anyway, I have hacked a FindQt5.cmake script and moved on. It's kind of simple, but does the job.

                If anyone is curious it's here for a while: https://pastebin.com/Tz0hTBTn

                sierdzioS 1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Alec Leamas
                  wrote on last edited by
                  #10

                  If anyone is curious it's here for a while: https://pastebin.com/Tz0hTBTn

                  1 Reply Last reply
                  0
                  • A Alec Leamas

                    @sierdzio It's not as simple as 'cmake files'. In particular, is the FindQt5Widgets.cmake and friends there? I also get a bunch of cmake files, but many important ones like this is missing.

                    Anyway, I have hacked a FindQt5.cmake script and moved on. It's kind of simple, but does the job.

                    If anyone is curious it's here for a while: https://pastebin.com/Tz0hTBTn

                    sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #11

                    @Alec-Leamas said in QT 14.2 cmake: Cannot find Qt5Widgets et. al.:

                    @sierdzio It's not as simple as 'cmake files'. In particular, is the FindQt5Widgets.cmake and friends there?

                    You're right, FindQt5x.cmake are not there. But, even without them, cmake works fine with prebuilt Qt - so perhaps these files are not needed at all?

                    (Z(:^

                    A 1 Reply Last reply
                    0
                    • sierdzioS sierdzio

                      @Alec-Leamas said in QT 14.2 cmake: Cannot find Qt5Widgets et. al.:

                      @sierdzio It's not as simple as 'cmake files'. In particular, is the FindQt5Widgets.cmake and friends there?

                      You're right, FindQt5x.cmake are not there. But, even without them, cmake works fine with prebuilt Qt - so perhaps these files are not needed at all?

                      A Offline
                      A Offline
                      Alec Leamas
                      wrote on last edited by Alec Leamas
                      #12

                      @sierdzio I was too quick, it's about other files. Here is the situation, comparing the "normal" installation with a cross-compile, focusing on the Widgets stuff :

                      $ find /opt/dont-use-qt5/ -name \*.cmake | grep Widgets
                      /opt/dont-use-qt5/lib/cmake/Qt5Widgets/Qt5WidgetsMacros.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5Widgets/Qt5WidgetsConfigVersion.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5Widgets/Qt5WidgetsConfigExtras.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5QuickWidgets/Qt5QuickWidgetsConfigVersion.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5MultimediaWidgets/Qt5MultimediaWidgetsConfigVersion.cmake
                      /opt/dont-use-qt5/lib/cmake/Qt5MultimediaWidgets/Qt5MultimediaWidgetsConfig.cmake
                      
                      
                      $ find -L ~/lib/android-sysroot/usr/Qt5/  -name \*.cmake | grep Widgets
                      $
                      

                      i. e., the Widgets stuff is just missing. Situation is similar for other modules

                      Since I basically trust the qt devs, I assume it's because my usecase isn't supported. This means that I cannot use future versions without checking them.

                      Ergo: better use my own stuff...

                      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