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. CMake get Qt5 source directory variable
Forum Updated to NodeBB v4.3 + New Features

CMake get Qt5 source directory variable

Scheduled Pinned Locked Moved Solved Installation and Deployment
6 Posts 2 Posters 598 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.
  • A Offline
    A Offline
    Alexey Serebryakov
    wrote on 5 Mar 2023, 16:28 last edited by
    #1

    Hi guys,
    how can I get Qt5 source directory in CMakeLists.txt?

    For example I have Qt5 installation on Windows: C:\Qt\5.12.9, on Linux ~/Qt/5.12.9. This folders contains Src path.

    So I need following in my CMakeLists.txt:

    set(MY_QT5_SRC_DIR C:\Qt\5.12.9\Src)

    Thanks a lot!

    C 1 Reply Last reply 5 Mar 2023, 16:50
    0
    • A Alexey Serebryakov
      5 Mar 2023, 17:07

      @Christian-Ehrlicher yeah I see,

      I wish build static library with C:\Qt\5.12.9\Src\qttools\src\shared\qtpropertybrowser for my app. :-). Yeah I know that can be find in Qt solution but in Qt source more comfortable because from the box.

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 5 Mar 2023, 17:28 last edited by
      #4

      Then copy the sources over to your sources. When I as a user want to compile your app and then would need the entire Qt sources I would give up.

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

      A 1 Reply Last reply 6 Mar 2023, 01:19
      1
      • A Alexey Serebryakov
        5 Mar 2023, 16:28

        Hi guys,
        how can I get Qt5 source directory in CMakeLists.txt?

        For example I have Qt5 installation on Windows: C:\Qt\5.12.9, on Linux ~/Qt/5.12.9. This folders contains Src path.

        So I need following in my CMakeLists.txt:

        set(MY_QT5_SRC_DIR C:\Qt\5.12.9\Src)

        Thanks a lot!

        C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 5 Mar 2023, 16:50 last edited by
        #2

        FindQt[456].cmake will and can't return you the directory of the sources Qt was compiled from since the sources are normally not distributed and also not needed to compile and link against Qt. Why do you need the Qt sources when you compile your app?

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

        A 1 Reply Last reply 5 Mar 2023, 17:07
        1
        • C Christian Ehrlicher
          5 Mar 2023, 16:50

          FindQt[456].cmake will and can't return you the directory of the sources Qt was compiled from since the sources are normally not distributed and also not needed to compile and link against Qt. Why do you need the Qt sources when you compile your app?

          A Offline
          A Offline
          Alexey Serebryakov
          wrote on 5 Mar 2023, 17:07 last edited by
          #3

          @Christian-Ehrlicher yeah I see,

          I wish build static library with C:\Qt\5.12.9\Src\qttools\src\shared\qtpropertybrowser for my app. :-). Yeah I know that can be find in Qt solution but in Qt source more comfortable because from the box.

          C 1 Reply Last reply 5 Mar 2023, 17:28
          0
          • A Alexey Serebryakov
            5 Mar 2023, 17:07

            @Christian-Ehrlicher yeah I see,

            I wish build static library with C:\Qt\5.12.9\Src\qttools\src\shared\qtpropertybrowser for my app. :-). Yeah I know that can be find in Qt solution but in Qt source more comfortable because from the box.

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 5 Mar 2023, 17:28 last edited by
            #4

            Then copy the sources over to your sources. When I as a user want to compile your app and then would need the entire Qt sources I would give up.

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

            A 1 Reply Last reply 6 Mar 2023, 01:19
            1
            • A Alexey Serebryakov has marked this topic as solved on 5 Mar 2023, 18:01
            • C Christian Ehrlicher
              5 Mar 2023, 17:28

              Then copy the sources over to your sources. When I as a user want to compile your app and then would need the entire Qt sources I would give up.

              A Offline
              A Offline
              Alexey Serebryakov
              wrote on 6 Mar 2023, 01:19 last edited by
              #5

              @Christian-Ehrlicher but what the package I need to install for build my app using Qt sources?

              C 1 Reply Last reply 6 Mar 2023, 07:05
              0
              • A Alexey Serebryakov
                6 Mar 2023, 01:19

                @Christian-Ehrlicher but what the package I need to install for build my app using Qt sources?

                C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 6 Mar 2023, 07:05 last edited by
                #6

                The Qt source package I would guess?

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

                1 Reply Last reply
                0

                1/6

                5 Mar 2023, 16:28

                • Login

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