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.
  • M Offline
    M Offline
    mandruk1331
    wrote on 24 Apr 2019, 17:57 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
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 24 Apr 2019, 17:59 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

      M 1 Reply Last reply 24 Apr 2019, 18:29
      4
      • C Christian Ehrlicher
        24 Apr 2019, 17:59

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

        M Offline
        M Offline
        mandruk1331
        wrote on 24 Apr 2019, 18:29 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
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 24 Apr 2019, 18:39 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

          M 1 Reply Last reply 24 Apr 2019, 19:11
          4
          • C Christian Ehrlicher
            24 Apr 2019, 18:39

            If you use target_link_libraries properly cmake does this for you.

            M Offline
            M Offline
            mandruk1331
            wrote on 24 Apr 2019, 19:11 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
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 24 Apr 2019, 19:20 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

              M 1 Reply Last reply 25 Apr 2019, 14:14
              3
              • C Christian Ehrlicher
                24 Apr 2019, 19:20

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

                M Offline
                M Offline
                mandruk1331
                wrote on 25 Apr 2019, 14:14 last edited by mandruk1331
                #7
                This post is deleted!
                1 Reply Last reply
                0

                1/7

                24 Apr 2019, 17:57

                • Login

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