2020-07-01 15:42:07 +00:00
|
|
|
The following table describes the mapping of configure options to CMake arguments.
|
|
|
|
|
|
|
|
| configure | cmake | Notes |
|
|
|
|
|---------------------------------------|---------------------------------------------------|-----------------------------------------------------------------|
|
|
|
|
| -prefix /opt/qt6 | -DCMAKE_INSTALL_PREFIX=/opt/qta6 | |
|
2022-02-22 17:51:16 +00:00
|
|
|
| -no-prefix (only available in Qt6) | -DCMAKE_INSTALL_PREFIX=$PWD (with bash) | In Qt5 this was done by specifying -prefix $PWD |
|
|
|
|
| or -DFEATURE_no_prefix=ON | |
|
2020-07-01 15:42:07 +00:00
|
|
|
| -extprefix /opt/qt6 | -DCMAKE_STAGING_PREFIX=/opt/qt6 | |
|
|
|
|
| -bindir <dir> | -DINSTALL_BINDIR=<dir> | similar for -headerdir -libdir and so on |
|
2020-11-10 14:31:55 +00:00
|
|
|
| -hostdatadir <dir> | -DINSTALL_MKSPECSDIR=<dir> | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -help | n/a | Handled by configure[.bat]. |
|
2022-04-05 13:13:38 +00:00
|
|
|
| -verbose | --log-level=STATUS | Sets the CMake log level to STATUS. The default one is NOTICE. |
|
2020-07-01 15:42:07 +00:00
|
|
|
| -continue | | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -redo | n/a | Handled by configure[.bat]. |
|
2020-07-01 15:42:07 +00:00
|
|
|
| -recheck [test,...] | | |
|
|
|
|
| -feature-foo | -DFEATURE_foo=ON | |
|
|
|
|
| -no-feature-foo | -DFEATURE_foo=OFF | |
|
|
|
|
| -list-features | | At the moment: configure with cmake once, |
|
|
|
|
| | | then use ccmake or cmake-gui to inspect the features. |
|
2020-10-13 09:56:49 +00:00
|
|
|
| -opensource | n/a | |
|
|
|
|
| -commercial | n/a | |
|
|
|
|
| -confirm-license | n/a | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -release | -DCMAKE_BUILD_TYPE=Release | |
|
|
|
|
| -debug | -DCMAKE_BUILD_TYPE=Debug | |
|
|
|
|
| -debug-and-release | -G "Ninja Multi-Config" | |
|
|
|
|
| | -DCMAKE_CONFIGURATION_TYPES=Release;Debug | |
|
2020-08-20 13:19:07 +00:00
|
|
|
| -optimize-debug | -DFEATURE_optimize_debug=ON | |
|
2020-08-21 06:40:54 +00:00
|
|
|
| -optimize-size | -DFEATURE_optimize_size=ON | |
|
2020-08-20 13:19:07 +00:00
|
|
|
| -optimized-tools | n/a | This affects only host tools. |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -force-debug-info | Use the RelWithDebInfo build config. | |
|
|
|
|
| -separate-debug-info | -DFEATURE_separate_debug_info=ON | |
|
2020-08-21 07:22:23 +00:00
|
|
|
| -gdb-index | -DFEATURE_enable_gdb_index=ON | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -strip | cmake --install . --strip | This affects the install targets generated by qmake. |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -gc-binaries | -DFEATURE_gc_binaries=ON | |
|
2020-08-24 08:39:49 +00:00
|
|
|
| -force-asserts | -DFEATURE_force_asserts=ON | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -developer-build | -DFEATURE_developer_build=ON | |
|
|
|
|
| -shared | -DBUILD_SHARED_LIBS=ON | |
|
|
|
|
| -static | -DBUILD_SHARED_LIBS=OFF | |
|
|
|
|
| -framework | -DFEATURE_framework=ON | |
|
|
|
|
| -platform <target> | -DQT_QMAKE_TARGET_MKSPEC=<mkspec> | |
|
2020-10-08 17:32:16 +00:00
|
|
|
| -xplatform <target> | -DQT_QMAKE_TARGET_MKSPEC=<mkspec> | Used for generating qmake-compatibility files. |
|
|
|
|
| | | If passed 'macx-ios-clang', will configure an iOS build. |
|
2020-07-01 15:42:07 +00:00
|
|
|
| -device <name> | equivalent to -xplatform devices/<name> | |
|
|
|
|
| -device-option <key=value> | -DQT_QMAKE_DEVICE_OPTIONS=key1=value1;key2=value2 | Only used for generation qmake-compatibility files. |
|
|
|
|
| | | The device options are written into mkspecs/qdevice.pri. |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -appstore-compliant | -DFEATURE_appstore_compliant=ON | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -qtnamespace <name> | -DQT_NAMESPACE=<name> | |
|
2020-09-21 13:45:28 +00:00
|
|
|
| -qtlibinfix <infix> | -DQT_LIBINFIX=<infix> | |
|
2023-09-13 14:31:52 +00:00
|
|
|
| -coverage <tool> | -DINPUT_coverage=<tool> | Enables code coverage using the specified tool. |
|
|
|
|
| -gcov | -DINPUT_coverage=gcov | Enables code coverage using the gcov tool. |
|
2020-08-24 19:05:05 +00:00
|
|
|
| -trace [backend] | -DINPUT_trace=yes or -DINPUT_trace=<backend> | |
|
|
|
|
| | or -DFEATURE_<backend> | |
|
2021-06-24 10:30:32 +00:00
|
|
|
| -sanitize address -sanitize undefined | -DFEATURE_sanitize_address=ON | Directly setting -DECM_ENABLE_SANITIZERS=foo is not supported |
|
|
|
|
| | -DFEATURE_sanitize_undefined=ON | |
|
2021-02-09 12:12:09 +00:00
|
|
|
| -c++std c++20 | -DFEATURE_cxx20=ON | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -sse2/-sse3/-ssse3/-sse4.1 | -DFEATURE_sse4=ON | |
|
|
|
|
| -mips_dsp/-mips_dspr2 | -DFEATURE_mips_dsp=ON | |
|
2020-08-18 08:59:03 +00:00
|
|
|
| -qreal <type> | -DQT_COORD_TYPE=<type> | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -R <string> | -DQT_EXTRA_RPATHS=path1;path2 | |
|
|
|
|
| -rpath | negative CMAKE_SKIP_BUILD_RPATH | |
|
|
|
|
| | negative CMAKE_SKIP_INSTALL_RPATH | |
|
2023-01-05 14:59:44 +00:00
|
|
|
| | negative CMAKE_MACOSX_RPATH | |
|
2020-08-25 06:17:23 +00:00
|
|
|
| -reduce-exports | -DFEATURE_reduce_exports=ON | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -reduce-relocations | -DFEATURE_reduce_relocations=ON | |
|
2020-07-01 15:42:07 +00:00
|
|
|
| -plugin-manifests | | |
|
2020-07-02 09:25:28 +00:00
|
|
|
| -static-runtime | -DFEATURE_static_runtime=ON | |
|
|
|
|
| -pch | -DBUILD_WITH_PCH=ON | |
|
2020-08-27 12:11:00 +00:00
|
|
|
| -ltcg | -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON or | |
|
|
|
|
| | -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>=ON | |
|
2022-03-29 14:18:34 +00:00
|
|
|
| -linker [bfd,gold,lld,mold] | -DINPUT_linker=<name> or | |
|
2020-08-20 07:06:16 +00:00
|
|
|
| | -DFEATURE_use_<name>_linker=ON | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -incredibuild-xge | n/a | This option enables remote distribution of Visual Studio |
|
|
|
|
| | | custom build steps for moc, uic, and rcc. |
|
|
|
|
| | | This lacks support in CMake. |
|
2020-07-01 15:42:07 +00:00
|
|
|
| -ccache | -DQT_USE_CCACHE=ON | |
|
2023-02-08 11:08:37 +00:00
|
|
|
| -unity-build | -DQT_UNITY_BUILD=ON | |
|
|
|
|
| -unity-build-batch-size <int> | -DQT_UNITY_BUILD_BATCH_SIZE=<int> | |
|
2020-10-01 12:48:37 +00:00
|
|
|
| -warnings-are-errors | -DWARNINGS_ARE_ERRORS=ON | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -no-pkg-config | -DFEATURE_pkg_config=OFF | |
|
2023-07-11 12:58:50 +00:00
|
|
|
| -vcpkg | -DQT_USE_VCPKG=ON | |
|
2020-08-13 12:36:50 +00:00
|
|
|
| -D <string> | -DQT_EXTRA_DEFINES=<string1>;<string2> | |
|
|
|
|
| -I <string> | -DQT_EXTRA_INCLUDEPATHS=<string1>;<string2> | |
|
|
|
|
| -L <string> | -DQT_EXTRA_LIBDIRS=<string1>;<string2> | |
|
|
|
|
| -F <string> | -DQT_EXTRA_FRAMEWORKPATHS=<string1>;<string2> | |
|
2020-10-08 17:32:16 +00:00
|
|
|
| -sdk <sdk> | -DQT_UIKIT_SDK=<value> | Should be provided a value like 'iphoneos' or 'iphonesimulator' |
|
|
|
|
| | | If no value is provided, a simulator_and_device build is |
|
|
|
|
| | | assumed. |
|
2020-10-05 12:49:39 +00:00
|
|
|
| -android-sdk <path> | -DANDROID_SDK_ROOT=<path> | |
|
2022-02-23 11:25:03 +00:00
|
|
|
| -android-ndk <path> | -DCMAKE_TOOLCHAIN_FILE=<toolchain file in NDK> | |
|
2022-03-08 13:08:00 +00:00
|
|
|
| -android-ndk-platform android-23 | -DANDROID_PLATFORM=android-23 | |
|
2020-10-05 12:49:39 +00:00
|
|
|
| -android-abis <abi_1>,...,<abi_n> | -DANDROID_ABI=<abi_1> | only one ABI can be specified |
|
|
|
|
| -android-style-assets | -DFEATURE_android_style_assets=ON | |
|
2020-09-11 17:28:01 +00:00
|
|
|
| -android-javac-source | -DQT_ANDROID_JAVAC_SOURCE=7 | Set the javac build source version. |
|
|
|
|
| -android-javac-target | -DQT_ANDROID_JAVAC_TARGET=7 | Set the javac build target version. |
|
2022-02-02 16:04:44 +00:00
|
|
|
| -skip <repo>,...,<repo_n> | -DBUILD_<repo>=OFF | |
|
2023-02-23 12:40:32 +00:00
|
|
|
| -submodules <repo>,...,<repo_n> | -DQT_BUILD_SUBMODULES=<repo>;...;<repo> | |
|
2020-12-02 10:47:24 +00:00
|
|
|
| -make <part> | -DQT_BUILD_TESTS=ON | A way to turn on tools explicitly is missing. If tests/examples |
|
|
|
|
| | -DQT_BUILD_EXAMPLES=ON | are enabled, you can disable their building as part of the |
|
|
|
|
| | | 'all' target by also passing -DQT_BUILD_TESTS_BY_DEFAULT=OFF or |
|
|
|
|
| | | -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF. Note that if you entirely |
|
|
|
|
| | | disable tests/examples at configure time (by using |
|
|
|
|
| | | -DQT_BUILD_TESTS=OFF or -DQT_BUILD_EXAMPLES=OFF) you can't then |
|
2022-02-23 11:25:03 +00:00
|
|
|
| | | build them separately, after configuration. |
|
2020-10-19 11:35:15 +00:00
|
|
|
| -nomake <part> | -DQT_BUILD_TESTS=OFF | A way to turn off tools explicitly is missing. |
|
|
|
|
| | -DQT_BUILD_EXAMPLES=OFF | |
|
CMake: Allow installation of example sources into the Qt prefix
In Qt 5 times, if Qt was configured with -make examples, running
make install would not only build and install the example binaries,
but would also install the example sources into the prefix.
Installation of example sources was not implemented when the Qt 6
build system has switched to using CMake.
There is still a use case for it though, mainly for Qt Creator, which
only shows the examples of a Qt kit if the sources are available.
In contrast to Qt 5, in Qt 6 we will not install example sources
by default. It will be opt in.
To enable installation of examples sources, configure with
configure -make examples -install-examples-sources
or
cmake -DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON
The -make examples part is required, otherwise
-install-examples-sources has no effect.
All example sources can be installed by calling
cmake --install . --component examples_sources
in the qt repo build directory.
In a top-level build, per-repo installation can be done using
cmake --install . --component examples_sources_<repo_name>
where repo_name could be 'qtbase'.
A single example's source can be installed by calling
cmake --install . --component examples_sources_<subdir_name>
where subdir_name is the subdirectory name of the example, e.g.
'gallery'.
Implement installation of example sources by hooking into the
qt_internal_add_example command.
This means that all examples in all repos need to be added via
qt_internal_add_example instead of add_subdirectory, to ensure the
sources are installed. The majority of repos already use it.
For testing purposes one can configure with
-DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON
-DQT_INTERNAL_NO_CONFIGURE_EXAMPLES=ON to allow testing installation
of examples sources without building them.
Take into account an additional variable called
QT_INTERNAL_EXAMPLES_SOURCES_INSTALL_PREFIX to allow installation of
example sources into a location different from the example binaries.
As a cleanup, the NAME option that could previously be passed to
qt_internal_add_example_external_project has been removed.
That's because it's never used anywhere and could not have worked
anyway because qt_internal_add_example_in_tree never handled it.
Pick-to: 6.6
Fixes: QTBUG-112135
Change-Id: I52aa5ec643ff7e212276c88d8dd2dfecdbdbeb0d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-08-07 10:15:35 +00:00
|
|
|
| -install-examples-sources | -DQT_INSTALL_EXAMPLES_SOURCES=ON | |
|
2020-12-08 14:45:21 +00:00
|
|
|
| -no-gui | -DFEATURE_gui=OFF | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -no-widgets | -DFEATURE_widgets=OFF | |
|
|
|
|
| -no-dbus | -DFEATURE_dbus=OFF | |
|
|
|
|
| -dbus [linked/runtime] | -DINPUT_dbus=[linked/runtime] | |
|
|
|
|
| -dbus-linked | -DINPUT_dbus=linked | |
|
|
|
|
| -dbus-runtime | -DINPUT_dbus=runtime | |
|
|
|
|
| -accessibility | -DFEATURE_accessibility=ON | |
|
|
|
|
| -doubleconversion | -DFEATURE_doubleconversion=ON | |
|
|
|
|
| | -DFEATURE_system_doubleconversion=ON/OFF | |
|
|
|
|
| -glib | -DFEATURE_glib=ON | |
|
|
|
|
| -inotify | -DFEATURE_inotify=ON | |
|
|
|
|
| -icu | -DFEATURE_icu=ON | |
|
|
|
|
| -pcre | -DFEATURE_pcre2=ON | |
|
|
|
|
| -pcre [system/qt] | -DFEATURE_system_pcre2=ON/OFF | |
|
|
|
|
| -pps | n/a | QNX feature. Not available for 6.0. |
|
|
|
|
| -zlib [system/qt] | -DFEATURE_system_zlib=ON/OFF | |
|
|
|
|
| -ssl | -DFEATURE_ssl=ON | |
|
|
|
|
| -openssl [no/yes/linked/runtime] | -DINPUT_openssl=no/yes/linked/runtime | |
|
|
|
|
| -openssl-linked | -DINPUT_openssl=linked | |
|
|
|
|
| -openssl-runtime | -DINPUT_openssl=runtime | |
|
|
|
|
| -schannel | -DFEATURE_schannel=ON | |
|
|
|
|
| -securetransport | -DFEATURE_securetransport=ON | |
|
|
|
|
| -sctp | -DFEATURE_sctp=ON | |
|
|
|
|
| -libproxy | -DFEATURE_libproxy=ON | |
|
|
|
|
| -system-proxies | -DFEATURE_system_proxies=ON | |
|
|
|
|
| -cups | -DFEATURE_cups=ON | |
|
|
|
|
| -fontconfig | -DFEATURE_fontconfig=ON | |
|
|
|
|
| -freetype [no/qt/system] | -DFEATURE_freetype=ON/OFF | |
|
|
|
|
| | -DFEATURE_system_freetype=ON/OFF | |
|
|
|
|
| -harfbuzz [no/qt/system] | -DFEATURE_harfbuzz=ON | |
|
|
|
|
| | -DFEATURE_system_harfbuzz=ON/OFF | |
|
|
|
|
| -gtk | -DFEATURE_gtk3=ON | |
|
|
|
|
| -lgmon | n/a | QNX-specific |
|
2020-12-08 14:45:21 +00:00
|
|
|
| -no-opengl | -DINPUT_opengl=no | |
|
|
|
|
| -opengl <api> | -DINPUT_opengl=<api> | |
|
|
|
|
| -opengles3 | -DFEATURE_opengles3=ON | |
|
|
|
|
| -egl | -DFEATURE_egl=ON | |
|
2020-08-28 13:38:30 +00:00
|
|
|
| -qpa <name> | -DQT_QPA_DEFAULT_PLATFORM=<name> | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -xcb-xlib | -DFEATURE_xcb_xlib=ON | |
|
|
|
|
| -direct2d | -DFEATURE_direct2d=ON | |
|
|
|
|
| -directfb | -DFEATURE_directfb=ON | |
|
|
|
|
| -eglfs | -DFEATURE_eglfs=ON | |
|
|
|
|
| -gbm | -DFEATURE_gbm=ON | |
|
|
|
|
| -kms | -DFEATURE_kms=ON | |
|
|
|
|
| -linuxfb | -DFEATURE_linuxfb=ON | |
|
|
|
|
| -xcb | -DFEATURE_xcb=ON | |
|
|
|
|
| -libudev | -DFEATURE_libudev=ON | |
|
|
|
|
| -evdev | -DFEATURE_evdev=ON | |
|
|
|
|
| -imf | n/a | QNX-specific |
|
|
|
|
| -libinput | -DFEATURE_libinput=ON | |
|
|
|
|
| -mtdev | -DFEATURE_mtdev=ON | |
|
2020-08-20 13:19:07 +00:00
|
|
|
| -tslib | -DFEATURE_tslib=ON | |
|
2020-08-21 19:33:07 +00:00
|
|
|
| -bundled-xcb-xinput | -DFEATURE_system_xcb_xinput=OFF | |
|
|
|
|
| -xkbcommon | -DFEATURE_xkbcommon=ON | |
|
|
|
|
| -gif | -DFEATURE_gif=ON | |
|
|
|
|
| -ico | -DFEATURE_ico=ON | |
|
|
|
|
| -libpng | -DFEATURE_libpng=ON | |
|
|
|
|
| -libjpeg | -DFEATURE_libjpeg=ON | |
|
|
|
|
| -sql-<driver> | -DFEATURE_sql_<driver>=ON | |
|
|
|
|
| -sqlite [qt/system] | -DFEATURE_system_sqlite=OFF/ON | |
|
2022-08-16 11:02:27 +00:00
|
|
|
| -disable-deprecated-up-to <hex_version> | -DQT_DISABLE_DEPRECATED_UP_TO=<hex_version> | |
|
2022-11-14 11:16:28 +00:00
|
|
|
| -mimetype-database-compression <type> | -DINPUT_mimetype_database_compression=<type> | Sets the compression type for mime type database. Supported |
|
|
|
|
| | | types: gzip, zstd, none. |
|