Linux 中最简编译 Qt / QtCreator 配置参数©🌱

Debian 11,Qt-5.15.?:

configure -prefix ~/Qt5.15 -release -strip -developer-build \
    -shared -silent -opengl desktop -fontconfig -system-freetype \
    -qt-doubleconversion -qt-pcre -qt-zlib -qt-harfbuzz \
    -ssl -openssl-runtime -gif -ico -qt-libpng -qt-libjpeg \
    -qt-tiff -qt-webp -plugin-sql-sqlite -qt-sqlite \
    -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci \
    -no-sql-odbc -no-sql-psql -no-sql-sqlite2 -no-sql-tds \
    -no-compile-examples -nomake examples -nomake tests \
    -skip qt3d -skip qtactiveqt -skip qtandroidextras \
    -skip qtcharts -skip qtcanvas3d -skip qtdatavis3d \
    -skip qtquick3d -skip qtconnectivity -skip qtfeedback \
    -skip qtlottie -skip qtpim -skip qtgamepad -skip qtscript \
    -skip qtlocation -skip qtsensors -skip qtserialbus -skip qtserialport \
    -skip qtwebchannel -skip qtwebsockets -skip qtwebview \
    -skip qtwebengine -skip qtwebglplugin 

QtWebkit 5.212:

qmake -r CONFIG-=debug CONFIG+=release \
    CMAKE_CONFIG+=ENABLE_TEST_SUPPORT=OFF \
    CMAKE_CONFIG+=ENABLE_API_TESTS=OFF \
    CMAKE_CONFIG+=ENABLE_WEBKIT2=OFF \
    CMAKE_CONFIG+=ENABLE_GEOLOCATION=OFF \
    CMAKE_CONFIG+=ENABLE_DEVICE_ORIENTATION=OFF \
    CMAKE_CONFIG+=USE_MEDIA_FOUNDATION=OFF \
    CMAKE_CONFIG+=USE_GSTREAMER=OFF \
    CMAKE_CONFIG+=ENABLE_XSLT=ON \
    CMAKE_CONFIG+=ENABLE_FULLSCREEN_API=ON \
    ./WebKit.pro

QtCreator-8.0.2:

cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" \
    -DCMAKE_INSTALL_PREFIX=~/Qt5.15/qtcreator \
    -DBUILD_PLUGIN_AUTOTEST=OFF \
    -DBUILD_PLUGIN_QMLDESIGNER=OFF \
    -DBUILD_PLUGIN_WEBASSEMBLY=OFF \
    -DBUILD_PLUGIN_CTFVISUALIZER=OFF \
    -DBUILD_PLUGIN_PYTHON=OFF \
    -DBUILD_PLUGIN_CLANGTOOLS=OFF \
    -DBUILD_PLUGIN_DOCKER=OFF \
    -DBUILD_PLUGIN_BOOT2QT=OFF \
    -DBUILD_PLUGIN_QNX=OFF \
    -DBUILD_PLUGIN_ANDROID=OFF \
    -DBUILD_PLUGIN_IOS=OFF \
    -DBUILD_PLUGIN_COCO=OFF \
    -DBUILD_PLUGIN_WELCOME=OFF \
    -DBUILD_PLUGIN_STUDIOWELCOME=OFF \
    -DBUILD_PLUGIN_UPDATEINFO=OFF \
    -DBUILD_PLUGIN_MARKETPLACE=OFF \
    -DBUILD_PLUGIN_HELLOWORLD=OFF \
    -DBUILD_PLUGIN_HELP=OFF \
    -DBUILD_PLUGIN_NIM=OFF \
    -DBUILD_PLUGIN_CONAN=OFF \
    -DBUILD_PLUGIN_CVS=OFF \
    -DBUILD_PLUGIN_VCSBASE=OFF \
    -DBUILD_PLUGIN_GIT=OFF \
    -DBUILD_PLUGIN_MERCURIAL=OFF \
    -DBUILD_PLUGIN_PERFORCE=OFF \
    -DBUILD_PLUGIN_SUBVERSION=OFF \
    -DBUILD_PLUGIN_CLEARCASE=OFF \
    -DBUILD_PLUGIN_GITLAB=OFF \
    -DBUILD_PLUGIN_MCUSUPPORT=OFF \
    -DBUILD_PLUGIN_BAZAAR=OFF \
    -DBUILD_PLUGIN_BAREMETAL=OFF

编辑 .bashrc,在其最后追加:

if [ -d ~/Qt5.15/bin ] ; then
    QT5DIR=~/Qt5.15
    # alias to call qtcreator
    alias qtcreator5='LD_LIBRARY_PATH=$QT5DIR/lib $QT5DIR/qtcreator/bin/qtcreator'
    # alias to call GoldenDict++
    alias gd5='LD_LIBRARY_PATH=$QT5DIR/lib  ~/svnRes/nwDeployed/bin5_x64_linux/goldendict.sh'
    # set QT_SCALE_FACTOR for app built with Qt5
    export QT_AUTO_SCREEN_SCALE_FACTOR=1
    export QT_SCALE_FACTOR=2
fi