Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to compile/link my apps with my Qt 6.7 installation?

How to compile/link my apps with my Qt 6.7 installation?

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 4 Posters 694 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.
  • T Offline
    T Offline
    Tom asso
    wrote on 23 Jul 2024, 08:03 last edited by
    #1

    I'm installing Qt 6.7.x on my ubuntu 22.04 system with online installer. I follow these installation instructions and at the end of the process have these subdirectories in my designated installation directory:

    6.7.0/          dist/  Examples/            installer.dat        junk             Licenses/         MaintenanceTool.dat  network.xml
    components.xml  Docs/  InstallationLog.txt  installerResources/  licenseInfo.txt  MaintenanceTool*  MaintenanceTool.ini  Tools/
    

    OK, but now how do I utilize these installed libraries and headers when building with cmake elsewhere on my system?

    Thanks!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tom asso
      wrote on 23 Jul 2024, 17:47 last edited by
      #6

      The cmake solution is to set CMAKE_PREFIX_PATH to the appropriate subdirectory in the designated Qt6 install directory. E.g. on my Ubuntu 22.04.3 system:
      export CMAKE_PREFIX_PATH=$HOME/Qt6/6.7.2/gcc_64/

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 23 Jul 2024, 09:00 last edited by
        #2

        If you use QtCreator you should have a new Kit for that version. If not add a new Kit and configure it to use that Qt version.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        T 1 Reply Last reply 23 Jul 2024, 14:23
        0
        • J jsulm
          23 Jul 2024, 09:00

          If you use QtCreator you should have a new Kit for that version. If not add a new Kit and configure it to use that Qt version.

          T Offline
          T Offline
          Tom asso
          wrote on 23 Jul 2024, 14:23 last edited by
          #3

          @jsulm I do not use qtcreator to build - just cmake from the command line.
          In this case is there a cmake variable I should set to point at my Qt6 installation directory?
          Thanks

          J 1 Reply Last reply 23 Jul 2024, 15:37
          0
          • T Tom asso
            23 Jul 2024, 14:23

            @jsulm I do not use qtcreator to build - just cmake from the command line.
            In this case is there a cmake variable I should set to point at my Qt6 installation directory?
            Thanks

            J Offline
            J Offline
            JoeCFD
            wrote on 23 Jul 2024, 15:37 last edited by JoeCFD
            #4

            @Tom-asso Try to set qmake of the installed Qt6 to PATH, for example
            export PATH=Qt6Path/bin/qmake6:$PATH
            or
            export PATH=Qt6Path/bin/qmake:$PATH
            to use your Qt installation first.

            T 1 Reply Last reply 23 Jul 2024, 17:44
            0
            • J JoeCFD
              23 Jul 2024, 15:37

              @Tom-asso Try to set qmake of the installed Qt6 to PATH, for example
              export PATH=Qt6Path/bin/qmake6:$PATH
              or
              export PATH=Qt6Path/bin/qmake:$PATH
              to use your Qt installation first.

              T Offline
              T Offline
              Tom asso
              wrote on 23 Jul 2024, 17:44 last edited by
              #5

              @JoeCFD - thanks but not using qmake, I'm using cmake.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tom asso
                wrote on 23 Jul 2024, 17:47 last edited by
                #6

                The cmake solution is to set CMAKE_PREFIX_PATH to the appropriate subdirectory in the designated Qt6 install directory. E.g. on my Ubuntu 22.04.3 system:
                export CMAKE_PREFIX_PATH=$HOME/Qt6/6.7.2/gcc_64/

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 23 Jul 2024, 18:39 last edited by
                  #7

                  Hi,

                  You also have the option to call the qt-cmake wrapper that can be found in the bin folder of your Qt installation.

                  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
                  2
                  • T Tom asso has marked this topic as solved on 5 Aug 2024, 20:51

                  7/7

                  23 Jul 2024, 18:39

                  • Login

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