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. Linux CMake will not use version in /opt
QtWS25 Last Chance

Linux CMake will not use version in /opt

Scheduled Pinned Locked Moved Solved General and Desktop
linuxcmake
3 Posts 1 Posters 270 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.
  • M Offline
    M Offline
    Musmuris
    wrote on 28 May 2024, 14:20 last edited by Musmuris
    #1

    Hi,
    Developing on Linux (actually WSL Ubuntu 22.04). I have the Ubuntu QT (6.2) packages installed (to /usr/lib) but I also used the installer to get v6.7.0 at /opt/Qt.

    I cannot seem to persuade CMake to use the version at /opt!

    My command line is this
    cmake -DCMAKE_PREFIX_PATH=/opt/Qt/6.7.0/gcc_x64/lib/cmake/Qt6 -DQt6_DIR:PATH=/opt/Qt/6.7.0/gcc_x64/lib/cmake/Qt6 -S . -b linux_build

    but the cache and build still use /usr/lib version. Any hints?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Musmuris
      wrote on 28 May 2024, 14:33 last edited by Musmuris
      #2

      Ok - I have no idea where I got that "x" in gcc_x64 - it's just gcc_64

      And the correct incantation seems to be

      cmake -DCMAKE_PREFIX_PATH:PATH=/opt/Qt/6.7.0/gcc_64 -S . -B linux_debug

      UPDATE:
      Additionally I needed

      sudo apt install libglx-dev libg1-mesa-dev

      Otherwise it mysteriously failed finding QtGui

      1 Reply Last reply
      0
      • M Musmuris has marked this topic as solved on 28 May 2024, 14:34
      • M Offline
        M Offline
        Musmuris
        wrote on 28 May 2024, 15:13 last edited by
        #3

        It was in typing the original question that I thought "what does QtCreator do"? - and got the command line from there

        1 Reply Last reply
        0

        2/3

        28 May 2024, 14:33

        • Login

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