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 use prefix, extprefix, hostprefix in configure to make a proper order in target directory?
QtWS25 Last Chance

How to use prefix, extprefix, hostprefix in configure to make a proper order in target directory?

Scheduled Pinned Locked Moved Solved Installation and Deployment
build from sourconfiguresource codeqt5.15.2building static
5 Posts 2 Posters 1.2k 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.
  • B Offline
    B Offline
    bibasmall
    wrote on 22 Jun 2023, 19:22 last edited by bibasmall
    #1

    Hello everyone!

    I am building Qt from sources and I'm wondering how should I use -prefix , -xtprefix , -hostprefix in configure command to get the same order as here (the prebuilt Qt from the Maintance tool):

    9608a835-a748-4588-ab2d-79ecec5579d7-image.png

    Yet I get everything (libs, binaries) placed near the source code, what is messy and makes it impossible to use with my projects. How do I separate the source code from the build?

    I've seen such suggestion for Linux:

    export INSTALLPATH=/home/alan/work/qt/qt_5.5.1_arm_cross_compiled
    ./configure ... -extprefix $INSTALLPATH/binaries -hostprefix $INSTALLPATH/tools
    

    Would it put binaries and tools from several Qt modules to the appropriate 2 folders? Do I have to fill the lib directory myself by copying libs from each module directory in the source dir then?

    S 1 Reply Last reply 23 Jun 2023, 06:04
    0
    • B bibasmall
      22 Jun 2023, 19:22

      Hello everyone!

      I am building Qt from sources and I'm wondering how should I use -prefix , -xtprefix , -hostprefix in configure command to get the same order as here (the prebuilt Qt from the Maintance tool):

      9608a835-a748-4588-ab2d-79ecec5579d7-image.png

      Yet I get everything (libs, binaries) placed near the source code, what is messy and makes it impossible to use with my projects. How do I separate the source code from the build?

      I've seen such suggestion for Linux:

      export INSTALLPATH=/home/alan/work/qt/qt_5.5.1_arm_cross_compiled
      ./configure ... -extprefix $INSTALLPATH/binaries -hostprefix $INSTALLPATH/tools
      

      Would it put binaries and tools from several Qt modules to the appropriate 2 folders? Do I have to fill the lib directory myself by copying libs from each module directory in the source dir then?

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 23 Jun 2023, 06:04 last edited by
      #2

      @bibasmall All you need is -prefix. The other flags are more useful when cross-compiling.

      Here is what I do when compiling Qt to get everything nicely separated. For example let's take Qt 6.5.1:

      • unpack Qt source code from zip / tarball to qt-everywhere-src-6.5.1
      • create directory 6.5.1
      • create directory 6.5.1-build
      • cd into 6.5.1-build and run ../qt-everywhere-src-6.5.1/configure here, with -prefix ../6.5.1
      • compile
      • install

      Now, if all went well I can remove 6.5.1-build and qt-everywhere-src-6.5.1, they are not necessary anymore. And folder 6.5.1 contains only final, installed executables and libraries, no "garbage" from compilation.

      (Z(:^

      B 1 Reply Last reply 23 Jun 2023, 09:30
      2
      • S sierdzio
        23 Jun 2023, 06:04

        @bibasmall All you need is -prefix. The other flags are more useful when cross-compiling.

        Here is what I do when compiling Qt to get everything nicely separated. For example let's take Qt 6.5.1:

        • unpack Qt source code from zip / tarball to qt-everywhere-src-6.5.1
        • create directory 6.5.1
        • create directory 6.5.1-build
        • cd into 6.5.1-build and run ../qt-everywhere-src-6.5.1/configure here, with -prefix ../6.5.1
        • compile
        • install

        Now, if all went well I can remove 6.5.1-build and qt-everywhere-src-6.5.1, they are not necessary anymore. And folder 6.5.1 contains only final, installed executables and libraries, no "garbage" from compilation.

        B Offline
        B Offline
        bibasmall
        wrote on 23 Jun 2023, 09:30 last edited by bibasmall
        #3

        @sierdzio

        Thanks for your reply. Sadly it didn't help completely. Could the problem be that I'm calling nmake module-qtbase? I want to build module by module to catch build errors.
        Here are my directories:

        C:\Qt\5.15.2>ls
        msvc2019_64  msvc2022_64_static  msvc2022_64_static-build  src
        

        After I called:

        cd C:\Qt\5.15.2\msvc2022_64_static-build && "../src/configure" -platform win32-msvc2022 -opensource -confirm-license -release -static -static-runtime -accessibility -qt-zlib -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -prefix "../msvc2022_64_static"
        

        During configuring, I got the message:

        Qt will be installed into 'C:\Qt\5.15.2\msvc2022_64_static'
        

        After that, I called:

        nmake module-qtbase
        

        But, as the result, C:\Qt\5.15.2\msvc2022_64_static is empty, everything is placed in C:\Qt\5.15.2\msvc2022_64_static-build (for example, binaries are inside C:\Qt\5.15.2\msvc2022_64_static-build\qtbase\bin), though I didn't get any error during the build.

        S 1 Reply Last reply 23 Jun 2023, 09:41
        0
        • B bibasmall
          23 Jun 2023, 09:30

          @sierdzio

          Thanks for your reply. Sadly it didn't help completely. Could the problem be that I'm calling nmake module-qtbase? I want to build module by module to catch build errors.
          Here are my directories:

          C:\Qt\5.15.2>ls
          msvc2019_64  msvc2022_64_static  msvc2022_64_static-build  src
          

          After I called:

          cd C:\Qt\5.15.2\msvc2022_64_static-build && "../src/configure" -platform win32-msvc2022 -opensource -confirm-license -release -static -static-runtime -accessibility -qt-zlib -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -prefix "../msvc2022_64_static"
          

          During configuring, I got the message:

          Qt will be installed into 'C:\Qt\5.15.2\msvc2022_64_static'
          

          After that, I called:

          nmake module-qtbase
          

          But, as the result, C:\Qt\5.15.2\msvc2022_64_static is empty, everything is placed in C:\Qt\5.15.2\msvc2022_64_static-build (for example, binaries are inside C:\Qt\5.15.2\msvc2022_64_static-build\qtbase\bin), though I didn't get any error during the build.

          S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 23 Jun 2023, 09:41 last edited by
          #4

          This is correct. Binaries are only installed after you run nmake install.

          (Z(:^

          B 1 Reply Last reply 23 Jun 2023, 09:59
          1
          • S sierdzio
            23 Jun 2023, 09:41

            This is correct. Binaries are only installed after you run nmake install.

            B Offline
            B Offline
            bibasmall
            wrote on 23 Jun 2023, 09:59 last edited by
            #5

            @sierdzio
            You are absolutely right, thank you. I didn't know about the nmake install command :)

            1 Reply Last reply
            0
            • B bibasmall has marked this topic as solved on 23 Jun 2023, 10:00

            3/5

            23 Jun 2023, 09:30

            • Login

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