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. Create Qt project build via Cmake
Forum Update on Monday, May 27th 2025

Create Qt project build via Cmake

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 494 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.
  • mandruk1331M Offline
    mandruk1331M Offline
    mandruk1331
    wrote on last edited by
    #1

    Hello, I would like to create a build of a qt project using Cmake. My main project depends on a custom static library, which will also be build by Cmake. Can someone tell where to start or provide a code snippet? Thank you in advance

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Using Qt with CMake is documented e.g. here: https://doc.qt.io/qt-5/cmake-manual.html

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      mandruk1331M 1 Reply Last reply
      4
      • Christian EhrlicherC Christian Ehrlicher

        Using Qt with CMake is documented e.g. here: https://doc.qt.io/qt-5/cmake-manual.html

        mandruk1331M Offline
        mandruk1331M Offline
        mandruk1331
        wrote on last edited by
        #3

        @Christian-Ehrlicher but how can I set the order of builds, because the main program depends on the library which has to be built previously?

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If you use target_link_libraries properly cmake does this for you.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          mandruk1331M 1 Reply Last reply
          4
          • Christian EhrlicherC Christian Ehrlicher

            If you use target_link_libraries properly cmake does this for you.

            mandruk1331M Offline
            mandruk1331M Offline
            mandruk1331
            wrote on last edited by
            #5

            @Christian-Ehrlicher But how can I create a static library using Cmake? My library uses Qt network headers

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Maybe taking a look at the cmake documentation will help: add_library

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              mandruk1331M 1 Reply Last reply
              3
              • Christian EhrlicherC Christian Ehrlicher

                Maybe taking a look at the cmake documentation will help: add_library

                mandruk1331M Offline
                mandruk1331M Offline
                mandruk1331
                wrote on last edited by mandruk1331
                #7
                This post is deleted!
                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