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. What do I have to add for the QT Websockets module in CMake?
QtWS25 Last Chance

What do I have to add for the QT Websockets module in CMake?

Scheduled Pinned Locked Moved Unsolved General and Desktop
cmakewebsocketwebsocketserver
4 Posts 2 Posters 8.0k 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.
  • A Offline
    A Offline
    Amazonasmann
    wrote on 24 Nov 2015, 15:33 last edited by
    #1

    In my current project, I only need the Qt Websocket module. What do I have to add to my CMake file to link it correctly?

    TARGET_LINK_LIBRARIES(main Qt5::WebSockets)
    qt5_use_modules(main WebSockets)
    

    does not seem to work. Any suggestions?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Nov 2015, 23:35 last edited by
      #2

      Hi,

      Do you have find_package(Qt5WebSockets REQUIRED) in your CMakeList.txt file ?

      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
      • A Offline
        A Offline
        Amazonasmann
        wrote on 8 Dec 2015, 13:21 last edited by
        #3

        sorry for the late answer, yes i have this in my CMakeLists.txt. Without this line, the output is something like " cannot use Websockets because it was not found yet".

        CMake Error at CMakeLists.txt:24 (find_package):
        By not providing "FindQt5WebSockets.cmake" in CMAKE_MODULE_PATH this
        project has asked CMake to find a package configuration file provided by
        "Qt5WebSockets", but CMake did not find one.
        Could not find a package configuration file provided by "Qt5WebSockets"
        with any of the following names:
        Qt5WebSocketsConfig.cmake
        qt5websockets-config.cmake
        Add the installation prefix of "Qt5WebSockets" to CMAKE_PREFIX_PATH or set
        "Qt5WebSockets_DIR" to a directory containing one of the above files.  If
        "Qt5WebSockets" provides a separate development package or SDK, be sure it
        has been installed.
        

        -- Configuring incomplete, errors occurred!

        I tried multiple installations on this machine including the online installer from the website and via apt-get. Is there an

        apt-get install libqt5websockets-dev
        

        or something available?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 8 Dec 2015, 21:26 last edited by
          #4

          What version of Qt are you using ? And how did you install it ?

          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

          • Login

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