Important: Please read the Qt Code of Conduct -

compile Qt from repository using linux

  • Hey,

    i want to compile Qt from source multiple times.

    I found this tutorial:
    But i'd prefer to download from a git repo, because i want to download and compile it within a script.
    Furthermore how would i clean and rebuild?? As far as i remember confclean is no more possible.

  • Moderators

    You can use the instructions above in a script... but anyway, since you ask for git repo, here is a guide especially for that use case:

    If you want to build several times from the same source code, simply run configure and make in another folder. Example:

    # Let's assume you have Qt source code in folder qt-src
    mkdir qt-build1
    cd qt-build1
    ./../qt-src/configure -prefix $PWD
    # Now rinse and repeat for your other builds
    cd ..
    mkdir qt-build2
    cd qt-build2
    ./../qt-src/configure -prefix $PWD

    If you want to keep all the build artifacts away from results (include files and libraries), you need to point -prefix to yet another directory. And you will have to run make install after compilation is done, so that the build system has a chance to copy the libs to your prefix folder.

Log in to reply