Disable features in cmake command line

Identical to "./configure --help", when a project uses cmake, we get building instructions like below,

1
2
3
4
mkdir bld
cd bld
cmake ..
cmake . -L

wait a while we will see all the variables cmake defined in cache.

Or directly look into CMakeCache.txt.

If we want to modify a variable to off, or say, disable some functionality,

1
FEATURE_test_name:BOOL=ON

we run cmake once again like this,

1
cmake -DFEATURE_test_name:BOOL=OFF ..

refer to:
https://www.oschina.net/question/231677_45266

Build qt source in Fedora35

Extract qt-everywhere-src-6.2.2.zip to directory named qt,

sudo dnf install libxcb libxcb-devel xcb-util xcb-util-devel xcb-util-*-devel libX11-devel libXrender-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libdrm-devel libXcursor-devel libXcomposite-devel

cd qt
mkdir bld
cd bld
cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/installed -DCMAKE_BUILD_TYPE="Debug" ..
cmake --build . --parallel
cmake --install . --prefix=`pwd`/installed

Can't locate English.pm in @INC

sudo dnf install perl-English

This application failed to start because no Qt platform plugin could be init...

If "xcb" things missing, we should "dnf install libxcb..." like above, and an annoying step we can't image is after we install required packages, we must delete CMakeCache.txt first and then to invoke cmake, if not, some modules like xcb-sm are always displayed not to be built.

Feature accessibility_atspi_bridge is already defined to be "OFF" and should now be set to "ON" when importing features from Qt6::Gui.

We only need to not let the message interrupt building progress,

/mnt/SDC2/qt/bld/installed/lib/cmake/Qt6/QtFeature.cmake:1136

	message(STATUS "Feature ${feature} is already defined to be \"${QT_FEATURE_${feature}}\" and should now be set to \"${value}\" when importing features from ${target}.")

refer to:
https://download.qt.io/official_releases/qtcreator/6.0/6.0.1/qt-creator-opensource-linux-x86_64-6.0.1.run
https://wiki.qt.io/Building_Qt_5_from_Git#Linux.2FX11
https://forum.qt.io/topic/121386/built-qt6-from-sources-problem-with-xcb-plugin/15
https://forum.qt.io/topic/128887/build-qt6-from-source-xcb-issue/3
https://forum.qt.io/topic/92834/configure-errors-disabling-x11-accessibility-bridge-d-bus-or-at-spi-is-missing/7