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. How to compile only a minimum set of modules?
Forum Updated to NodeBB v4.3 + New Features

How to compile only a minimum set of modules?

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 2 Posters 7.9k Views 2 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.
  • J Offline
    J Offline
    Jakob
    wrote on last edited by
    #1

    I'm trying to compile Qt 5.6.1 from source, which I downloaded as a .zip. In our application we only use a small subset of the modules - to be precize, in our CMake-based infrastructure we have currently:

    find_package(Qt5Core REQUIRED)
    find_package(Qt5Widgets REQUIRED)
    find_package(Qt5OpenGL REQUIRED)
    find_package(Qt5Concurrent REQUIRED)
    find_package(Qt5Designer REQUIRED)
    find_package(Qt5Svg REQUIRED)
    find_package(Qt5Test REQUIRED)
    find_package(Qt5PrintSupport REQUIRED)
    find_package(Qt5Gui REQUIRED)
    

    As far as I can tell, this only requires qtbase, qtsvg, and qttools (possibly some more, but I can't find easily how these package names map into module names).

    According to http://doc.qt.io/qt-5/configure-options.html: 'it is possible to include or exclude particular Qt modules'. In other words: I expected to be able to tell the configure script to skip all modules, except the ones mentioned above. But the documentation then only mentions how to skip individual modules.

    Am I really forced to write out a -skip module for every single module, except the ones I need, or is there some more efficient way to compile only what I need? Maybe I should just simply remove the folders from the base source folder?

    kshegunovK 1 Reply Last reply
    0
    • J Jakob

      I'm trying to compile Qt 5.6.1 from source, which I downloaded as a .zip. In our application we only use a small subset of the modules - to be precize, in our CMake-based infrastructure we have currently:

      find_package(Qt5Core REQUIRED)
      find_package(Qt5Widgets REQUIRED)
      find_package(Qt5OpenGL REQUIRED)
      find_package(Qt5Concurrent REQUIRED)
      find_package(Qt5Designer REQUIRED)
      find_package(Qt5Svg REQUIRED)
      find_package(Qt5Test REQUIRED)
      find_package(Qt5PrintSupport REQUIRED)
      find_package(Qt5Gui REQUIRED)
      

      As far as I can tell, this only requires qtbase, qtsvg, and qttools (possibly some more, but I can't find easily how these package names map into module names).

      According to http://doc.qt.io/qt-5/configure-options.html: 'it is possible to include or exclude particular Qt modules'. In other words: I expected to be able to tell the configure script to skip all modules, except the ones mentioned above. But the documentation then only mentions how to skip individual modules.

      Am I really forced to write out a -skip module for every single module, except the ones I need, or is there some more efficient way to compile only what I need? Maybe I should just simply remove the folders from the base source folder?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      Hi Jakob!

      @Jakob said in How to compile only a minimum set of modules?:

      Am I really forced to write out a -skip module for every single module, except the ones I need, or is there some more efficient way to compile only what I need?

      No, you can build individual modules (bear in mind, here I mean qtbase, qt3d etc.) After you run configure, you can call make like this:

      $ make module-qtbase
      

      to build the base module for example.

      @Jakob said in How to compile only a minimum set of modules?:

      Maybe I should just simply remove the folders from the base source folder?

      No, don't do that. Just build whatever you need (as shown above) and install it ( into a prefixed location) with the usual make install.

      Kind regards.

      Read and abide by the Qt Code of Conduct

      J 1 Reply Last reply
      1
      • kshegunovK kshegunov

        Hi Jakob!

        @Jakob said in How to compile only a minimum set of modules?:

        Am I really forced to write out a -skip module for every single module, except the ones I need, or is there some more efficient way to compile only what I need?

        No, you can build individual modules (bear in mind, here I mean qtbase, qt3d etc.) After you run configure, you can call make like this:

        $ make module-qtbase
        

        to build the base module for example.

        @Jakob said in How to compile only a minimum set of modules?:

        Maybe I should just simply remove the folders from the base source folder?

        No, don't do that. Just build whatever you need (as shown above) and install it ( into a prefixed location) with the usual make install.

        Kind regards.

        J Offline
        J Offline
        Jakob
        wrote on last edited by
        #3

        @kshegunov
        Thanx a lot for your answer - it makes a lot of sense. One question remains: will the install target know which individual modules I chose to build? Typically the install target is just a alias for all available installation targets, which would then recursively still build everything.

        kshegunovK 2 Replies Last reply
        0
        • J Jakob

          @kshegunov
          Thanx a lot for your answer - it makes a lot of sense. One question remains: will the install target know which individual modules I chose to build? Typically the install target is just a alias for all available installation targets, which would then recursively still build everything.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @Jakob said in How to compile only a minimum set of modules?:

          Typically the install target is just a alias for all available installation targets, which would then recursively still build everything.

          Yes, you might be right about this. I often build "developers' build", so there's no install step, and you're probably right that it'll try to build the other modules. Hm. I don't know if you can request specific modules directly from the configure script. I'll check something and get back to you.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • J Jakob

            @kshegunov
            Thanx a lot for your answer - it makes a lot of sense. One question remains: will the install target know which individual modules I chose to build? Typically the install target is just a alias for all available installation targets, which would then recursively still build everything.

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by kshegunov
            #5

            @Jakob
            Yes, you're correct. However, you can install only the modules with:

            $ make module-<modulename>-install_targets
            

            I hope that helps.

            Kind regards.

            Read and abide by the Qt Code of Conduct

            J 2 Replies Last reply
            1
            • kshegunovK kshegunov

              @Jakob
              Yes, you're correct. However, you can install only the modules with:

              $ make module-<modulename>-install_targets
              

              I hope that helps.

              Kind regards.

              J Offline
              J Offline
              Jakob
              wrote on last edited by
              #6

              @kshegunov Excellent, thanks a lot!

              kshegunovK 1 Reply Last reply
              1
              • J Jakob

                @kshegunov Excellent, thanks a lot!

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by
                #7

                You're welcome!

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                1
                • kshegunovK kshegunov

                  @Jakob
                  Yes, you're correct. However, you can install only the modules with:

                  $ make module-<modulename>-install_targets
                  

                  I hope that helps.

                  Kind regards.

                  J Offline
                  J Offline
                  Jakob
                  wrote on last edited by
                  #8

                  For future reference: the actual name of the installation targets are:

                  $ make module-<modulename>-install_subtargets
                  
                  1 Reply Last reply
                  3

                  • Login

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