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. CMake Supporting Qt 5.0 and Qt6
Forum Updated to NodeBB v4.3 + New Features

CMake Supporting Qt 5.0 and Qt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 1.4k Views 3 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.
  • VRoninV Offline
    VRoninV Offline
    VRonin
    wrote on last edited by VRonin
    #1

    Hi All,
    I'm migrating on of my projects to Qt6 but I want to keep backwards compatibility with Qt 5.0.2
    The suggested workflow in the docs works well for new-ish versions of Qt but when I try with 5.0.2 I get:

    CMake Error at src/CMakeLists.txt:4 (find_package):
      Could not find a package configuration file provided by "QT" with any of the following names:
        Qt6Config.cmake
        qt6-config.cmake
        Qt5Config.cmake
        qt5-config.cmake
    

    What's the minimum supported version of Qt5? Is there any workaround you can think of to make it backwards-compatible with 5.0.2?


    System Info:

    • Ubuntu 12.04
    • CMake 3.2.3
    • g++ 6.2
    • Qt 5.0.2

    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
    ~Napoleon Bonaparte

    On a crusade to banish setIndexWidget() from the holy land of Qt

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Partially answer my own question: Qt 5.1.1 works. Now any smart Idea on how to support 5.0?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

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

        Hi,

        The quick and dirty that comes to mind would be to copy/modify the cmake files from a close Qt version and drop them into your 5.0.2 installation.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        VRoninV 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          The quick and dirty that comes to mind would be to copy/modify the cmake files from a close Qt version and drop them into your 5.0.2 installation.

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by VRonin
          #4

          @SGaist Agreed but not viable. It's a library so hacking the Qt installation of the end user is not possible

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

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

            I thought so...

            Will it be system Qt or custom installed ?

            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
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              System. I use this ppa for my CI machine

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              0
              • VRoninV VRonin

                @SGaist Agreed but not viable. It's a library so hacking the Qt installation of the end user is not possible

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #7

                @VRonin said in CMake Supporting Qt 5.0 and Qt6:

                @SGaist Agreed but not viable. It's a library so i hacking the Qt installation of the end user is not possible

                Should a symlink into the binary's build/cmake directory work (I honestly don't know)?

                Read and abide by the Qt Code of Conduct

                VRoninV 1 Reply Last reply
                0
                • kshegunovK kshegunov

                  @VRonin said in CMake Supporting Qt 5.0 and Qt6:

                  @SGaist Agreed but not viable. It's a library so i hacking the Qt installation of the end user is not possible

                  Should a symlink into the binary's build/cmake directory work (I honestly don't know)?

                  VRoninV Offline
                  VRoninV Offline
                  VRonin
                  wrote on last edited by
                  #8

                  @kshegunov said in CMake Supporting Qt 5.0 and Qt6:

                  Should a symlink into the binary's build/cmake directory work (I honestly don't know)?

                  Nah, the problem is that the folder lib/cmake/Qt5 doesn't exist in Qt 5.0 so the necessary root config files are missing

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  kshegunovK 1 Reply Last reply
                  0
                  • VRoninV VRonin

                    @kshegunov said in CMake Supporting Qt 5.0 and Qt6:

                    Should a symlink into the binary's build/cmake directory work (I honestly don't know)?

                    Nah, the problem is that the folder lib/cmake/Qt5 doesn't exist in Qt 5.0 so the necessary root config files are missing

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #9

                    @VRonin said in CMake Supporting Qt 5.0 and Qt6:

                    Nah, the problem is that the folder lib/cmake/Qt5 doesn't exist in Qt 5.0 so the necessary root config files are missing

                    I see, it was a long shot anyway. I'm completely out of my element here.

                    Read and abide by the Qt Code of Conduct

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

                      Didn't KDE's ecm module provide a find script for Qt 5 at that time ?

                      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
                      1

                      • Login

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