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?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 4 Posters 819 Views 1 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.
  • Tom assoT Offline
    Tom assoT Offline
    Tom asso
    wrote on 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
    • Tom assoT Offline
      Tom assoT Offline
      Tom asso
      wrote on 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
      • jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on 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

        Tom assoT 1 Reply Last reply
        0
        • jsulmJ jsulm

          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.

          Tom assoT Offline
          Tom assoT Offline
          Tom asso
          wrote on 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

          JoeCFDJ 1 Reply Last reply
          0
          • Tom assoT Tom asso

            @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

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on 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.

            Tom assoT 1 Reply Last reply
            0
            • JoeCFDJ JoeCFD

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

              Tom assoT Offline
              Tom assoT Offline
              Tom asso
              wrote on last edited by
              #5

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

              1 Reply Last reply
              0
              • Tom assoT Offline
                Tom assoT Offline
                Tom asso
                wrote on 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
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 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
                  • Tom assoT Tom asso has marked this topic as solved on

                  • Login

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