summaryrefslogtreecommitdiffstats
path: root/cmake/configure-cmake-mapping.md
Commit message (Collapse)AuthorAgeFilesLines
* Map the 'verbose' configure option to CMakeAlexey Edelev2022-04-061-1/+1
| | | | | | | | Raise the CMake log level to STATUS when the 'verbose' argument is passed to the configure script. Change-Id: I736d95ab66b115f8416eec7f9e2ee96d1580c78d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Add mold to helpTasuku Suzuki2022-03-311-1/+1
| | | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-99270 Change-Id: I08ee2b328a1dba2bf0172e5a03ddb32925401d3b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake:Android: Use ANDROID_PLATFORM instead of ANDROID_NATIVE_API_LEVELAssam Boudjelthia2022-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | ANDROID_NATIVE_API_LEVEL is an alias for ANDROID_PLATFORM and the Android's CMake docs [1] uses directly ANDROID_PLATFORM so let's use that as well. Also, NDK r23b seems to have removed the part of code from android.toolchain.cmake that handles ANDROID_NATIVE_API_LEVEL to set the correct value to ANDROID_PLATFORM. With this change, CMake will pass the value from the configure argument -android-ndk-platform as -DANDROID_PLATFORM instead of -DANDROID_NATIVE_API_LEVEL. Otherwise, if if -DANDROID_NATIVE_API_LEVEL is passed directly to CMake, it should work as before. [1] https://developer.android.com/ndk/guides/cmake#build-command Pick-to: 6.3 Task-number: QTQAINFRA-4837 Change-Id: I5c21af53ac91e11a27c4b033313d22d1115c1abc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: CMake: Add -no-prefix optionAlexandru Croitor2022-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new -no-prefix option that can be used to build Qt without having to install it. Currently, -no-prefix is already implied by -developer-build, but -developer-build also implies -warnings-are-errors and -feature-private-tests, which not everyone might want to use. Some Qt builders likely use -developer-build for the no-prefix behavior, hence we introduce a standalone -no-prefix option to offer a nicer user experience without -Werror and friends. Previously it was possible to achieve the same by specifying -prefix $PWD, but that relies on $PWD expanding property in the used shell. The new -no-prefix doesn't depend on the type of the shell and is shorter to type. Internally this gets passed by configure as -DINPUT_no_prefix=yes to CMake, and transformed into a -DQT_FEATURE_no_prefix=ON feature. The feature also gets automatically auto-detected to ON if developer-build is set, -prefix is either unset or $PWD. CMake code should still query QT_WILL_INSTALL to decide whether files need to be installed or not. As a drive-by, we now also export QT_FEATURE_developer_build to be available for querying during configuration of other repos (previously it was only possible to query FEATURE_developer_build). Pick-to: 6.2 6.3 Change-Id: Iaa6c8d8ae2b736282e9949d2a5d7f412e290a253 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix the mapping between configure arguments and CMake variablesAlexey Edelev2022-02-241-3/+3
| | | | | | | Pick-to: 6.2 6.3 Fixes: QTBUG-101172 Change-Id: Ie1e01880911e771eedbf29b0d2d0607bc25b0549 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Introduce -submodules optionAlexandru Croitor2022-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option is used to specify a list of Qt repos (git submodules) that should be included in the configuration of a top-level Qt build. The option takes a comma-separated list of qt submodule names e.g. 'qtbase,qtsvg,qtdeclarative' It can also take a single value like 'qtbase' or 'qtquick3d'. Each specified submodule and all of its transitive dependencies will be included when configuring the top-level Qt build (assuming that the submodules have previously been already checked out). Any missing submodules or dependencies will not be automatically checked out, but rather skipped. This can result in a failed configuration if a required submodule is missing. If some optional transitive submodule dependency is not desired in the build, you can combine the -submodules option together with -skip options. E.g. configuring with -submodules qtdoc,qtnetworkauth -skip qtmultimedia,qtimageformats will result in a top-level build with the following submodules: - qtbase (common dependency) - qttools (dependency of qtdoc) - qtactiveqt dependency of qttools) - qshadertools (dependency of qtdeclarative) - qtdeclarative (explicit) - qtnetworkauth (explicit) - qtdoc (explicit) Pick-to: 6.2 6.3 Fixes: QTBUG-100388 Change-Id: Ie8c47cfd1d1e0e44a27260bf9ddf968531cc1cc0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* configure: Allow specifying a comma separated list to -skip optionAlexandru Croitor2022-02-031-1/+1
| | | | | | | | | | | | | | | | This makes skipping a list of submodules more concise. e.g. instead of passing -skip qtsvg -skip qtimageformats -skip qtmultimedia pass -skip qtsvg,qtimageformats,qtmultimedia Pick-to: 6.2 6.3 Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove dysfunctional -coverage configure argumentJoerg Bornemann2021-08-101-1/+0
| | | | | | | | | | | | | | The -coverage argument merely added compiler flags for the Qt build. It was never properly ported to the CMake build, and it doesn't seem feasible to have configure arguments for every possible compiler option. The same can be achieved by passing the needed compiler option to CMake, for example: CMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard Pick-to: 6.2 Fixes: QTBUG-86227 Change-Id: Ieef9acaedc0a839f9fb35b4403395eea28643864 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove unsupported host-related configure optionsJoerg Bornemann2021-07-061-4/+0
| | | | | | | | | | | | | The following host-related configure options were unsupported since Qt 6.0 and are now completely removed: -hostprefix -external-hostbindir -host*dir (except -hostdatadir) -android-ndk-host Pick-to: 6.2 Change-Id: Ib69d90c40ef546f61bf87b1f443eb9d10f7a5a21 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove outdated information from configure-cmake-mapping.mdJoerg Bornemann2021-07-061-2/+0
| | | | | | Pick-to: 6.2 Change-Id: I5101a3d7d07e4c0e818fb005707d99c6afe8f589 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Propagate sanitizer flags to public projectsAlexandru Croitor2021-06-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that Qt user projects build with sanitizer flags if Qt was configured with any of the sanitizers enabled. To compile Qt with sanitizer support enable any of Qt sanitizer features. Passing -DECM_ENABLE_SANITIZERS=address to CMake is NOT supported anymore. When configuring Qt using CMake directly, pass -DFEATURE_sanitizer_address=ON -DFEATURE_sanitizer_undefined=ON instead of -DECM_ENABLE_SANITIZERS=address;undefined When configuring Qt with the configure script pass -sanitize address -sanitize undefined as usual. QtConfig.cmake now records the sanitizer options that should be enabled for all consuming projects based on the enabled Qt features. This applies to internal Qt builds as well as well as tests an examples. The recorded sanitizer options are assigned to the ECM_ENABLE_SANITIZERS variable in the directory scope where find_package(Qt6) is called. The ECMEnableSanitizers module is included to add the necessary flags to all targets in that directory scope or its children. This behavior can be opted out by setting the QT_NO_ADD_SANITIZER_OPTIONS variable in projects that use Qt and might be handling sanitizer options differently. Amends 7e03bc39b8bcdaa4e83e72ac99e117561c124951 Pick-to: 6.2 Fixes: QTBUG-87989 Task-number: QTBUG-92083 Change-Id: I2e3371147277bdf8f55a39abaa34478dea4853a6 Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update name of c++2a to c++20Kai Köhne2021-02-101-1/+1
| | | | | | | | | | Keep the c++2a feature, but make it an alias for compatibility purposes. Pick-to: 6.1 Change-Id: I6f153109be84659806f1b7a57a88a187875166d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Document some missing configure cmake mappingsLi Xinwei2020-12-081-5/+5
| | | | | | Pick-to: 6.0 Change-Id: I4b15dde581e28aece52d7f98cb3d94827e8bcc33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Add -qt-host-path to configure's help screenJoerg Bornemann2020-12-071-1/+1
| | | | | | Pick-to: 6.0 Change-Id: Ia32377e08d72f82e71ce6f2c08e61bd8991b3077 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: mention the QT_BUILD_X_BY_DEFAULT=OFFGiuseppe D'Angelo2020-12-021-2/+7
| | | | | | | | | | Which is probably the direct port of -nomake XXX, as qmake always offered the way to build tests/examples/etc. after configuring without, while cmake doesn't. Pick-to: 6.0 Change-Id: I85b039e56cde3ddfaf661385100d3c3a8cc2ac16 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Name QT_NO_MAKE_*/BUILD_* variables consistentlyJoerg Bornemann2020-11-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency, apply the following renamings: QT_NO_MAKE_EXAMPLES -> QT_BUILD_EXAMPLES_BY_DEFAULT QT_NO_MAKE_TESTS -> QT_BUILD_TESTS_BY_DEFAULT QT_NO_MAKE_TOOLS -> QT_BUILD_TOOLS_BY_DEFAULT BUILD_EXAMPLES -> QT_BUILD_EXAMPLES BUILD_TESTING -> QT_BUILD_TESTS This should help to better convey the difference between "BUILD" and "NO_MAKE". To configure tests, but not to build them by default, pass the following to CMake: -DQT_BUILD_TESTS=ON -DQT_BUILD_TESTS_BY_DEFAULT=OFF Analoguous for examples: -DQT_BUILD_EXAMPLES=ON -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF Tools can be excluded from the default build with: -DBUILD_TOOLS_BY_DEFAULT=OFF The variable BUILD_TESTING is still available and initialized with the value of QT_BUILD_TESTS. Pick-to: 6.0 6.0.0 Change-Id: Ie5f29dfbdca8bfa8d687981dfe8c19c0397ca080 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Map configure -hostdatadir to INSTALL_MKSPECSDIRJoerg Bornemann2020-11-101-0/+1
| | | | | | | | | | In the qmake-based build, the hostdatadir is the directory where "Data used by qmake" is located. In the CMake build the equivalent is INSTALL_MKSPECSDIR. Create the mapping accordingly. Fixes: QTBUG-88211 Change-Id: I9e3d1af24bc7f41333ef2269fced5ab3fcfa848d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Ignore license-related configure argumentsJoerg Bornemann2020-10-171-3/+3
| | | | | | | | | | Do not print warnings for the configure arguments -commercial, -opensource and -confirm-license. We're not removing the arguments yet to keep existing build scripts working. Fixes: QTBUG-86096 Change-Id: Ieb63e2f2b81c022e8559cde6c3e0be0b8ce655ca Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix the -sanitize configure optionJoerg Bornemann2020-10-121-1/+1
| | | | | | | | This needs to map to ECM_ENABLE_SANITIZERS. Fixes: QTBUG-87316 Change-Id: I9e983728af0ba69fd428944e647f0afae8c61772 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement missing iOS-related configure optionsAlexandru Croitor2020-10-121-2/+5
| | | | | | | | | | | | | | | Detect an iOS build when either an -sdk option is passed or when -xplatform macx-ios-clang is passed as a target mkspec. Now that CMake 3.17 is released, change the default behavior of the iOS build to configure with simulator_and_device set to ON, like it is with qmake. Update the documentation regarding iOS configuration. Change-Id: I91aaf706610b8d3c69f1ad4ba9dadee2b1e5db97 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Implement missing Android-related configure optionsJoerg Bornemann2020-10-061-6/+6
| | | | | | | | | | | | | | Implement the last remaining Android-related configure options for the CMake build. Print warnings for options that have no equivalent in the CMake build. Let -android-ndk automatically deduce the CMake toolchain file, and error out if that fails with a hint how to fix the situation. Task-number: QTBUG-85373 Change-Id: I8399e5334ae0f1f6634e381775a308d34f7c482b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -reduce-exportsJoerg Bornemann2020-10-051-1/+1
| | | | | | | | | | | | | | | | | This option maps to FEATURE_reduce_exports. The feature is on by default, except for MSVC. The reduce_exports configure test is not used in the CMake build. The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target properties are now explicitly initialized in the qt_set_common_target_properties function, because we don't have access to the feature in QtSetup.cmake where the CMAKE_<LANG>_VISIBILITY_PRESET variables were set before. Task-number: QTBUG-85373 Change-Id: I378453f0e0665731970016170302871e20ceb4e2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix -[no-]warnings-are-errors configure argumentJoerg Bornemann2020-10-011-2/+1
| | | | | | | | The CMake build uses the WARNINGS_ARE_ERRORS variable, and the feature warnings_are_errors exists only in the qmake build. Change-Id: I1e548b30b210b3dd1b2f23041d490a981312f4ba Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake Build: Add support for -qtlibinfix configure parameterCristian Adam2020-09-231-1/+1
| | | | | | | | | Rename all libQt6*.so to libQt6*<infix>.so Task-number: QTBUG-85438 Change-Id: I4b91ffaaec7bea61454b0d3c794c77f2d0868d54 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: build add flags for building QtAndroid.jarAssam Boudjelthia2020-09-161-0/+2
| | | | | | | | | | | | | Adds -source, -target, -Xlint:unchecked, -bootclasspath flags. Setting default javac build source and target versions to 8. Allow setting custom values for javac build versions via -DQT_ANDROID_JAVAC_SOURCE, and -DQT_ANDROID_JAVAC_TARGET. Task-number: QTBUG-86282 Change-Id: I98f4f193ac96016dc722d178594d7fd401202f68 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -ltcgJoerg Bornemann2020-09-111-1/+2
| | | | | | | | | | | | | | | | | | | This configure switch sets the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> per release config to ON. The feature 'ltcg' is enabled if any of the variables CMAKE_INTERPROCEDURAL_OPTIMIZATION, CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> are ON. In order to implement the check, configurejson2cmake had to be extended to be able to write extra CMake code before and after the feature definition. This extra code can be added to a feature mapping below the keys "cmakePrelude" and "cmakeEpilogue". Task-number: QTBUG-85373 Change-Id: Ia2eb907edcf087f137977a9b090705397f83eb05 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Implement configure -qpaJoerg Bornemann2020-09-111-1/+1
| | | | | Change-Id: I38a938cda91a525d2af22deec864c6a12af3e29d Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove the -no-compile-examples configure switchJoerg Bornemann2020-09-111-1/+0
| | | | | | | | | | | | If '-make examples -no-compile-examples' was specified, sources of Qt's examples would be installed, but the examples would not be built. This switch has always been a source for confusion and is only interesting for distributors, who can just package the examples directory tree. Change-Id: I0291d70e4951d98b553a4abf217db49d05316d3a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Document more configure argument mappingsJoerg Bornemann2020-09-101-57/+66
| | | | | Change-Id: I4f96fd59566d011088e426342db9cc6536d63a71 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -traceJoerg Bornemann2020-09-011-1/+2
| | | | | | Task-number: QTBUG-85373 Change-Id: Ib9ac35ec98dd5b6c272f58f8a61a124d1d262ec0 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Implement configure -force-assertsJoerg Bornemann2020-08-271-1/+1
| | | | | Change-Id: Ife15b8d008c5b3f5eed61ec3bc048fda4c4b4e46 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -gdb-indexJoerg Bornemann2020-08-231-1/+1
| | | | | Change-Id: Iea0fb99297751b1baf830a416ea5041d0b9a3b63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -optimize-sizeJoerg Bornemann2020-08-231-1/+1
| | | | | | | | | | | | This configure switch controls the feature 'optimize_size'. This isn't merely a mapping to CMAKE_BUILD_TYPE=MinSizeRel, because we potentially want to combine -optimize-size with -force-debug-info, which maps to CMAKE_BUILD_CONFIG=RelWithDebInfo. Task-number: QTBUG-85373 Change-Id: I1a9343ebc54816f52e90e9d33ea3df4c99b1ec9f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Document more configure argument mappingsJoerg Bornemann2020-08-231-3/+3
| | | | | Change-Id: Icda71c14cde638e874cc2e6406527b9c98535165 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -linker [bfd,gold,lld]Joerg Bornemann2020-08-201-1/+2
| | | | | | Fixes: QTBUG-86155 Change-Id: I5ba2d3b52d9ca240b48904c492f7902a056c0292 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -qreal <type>Joerg Bornemann2020-08-191-1/+1
| | | | | | | | | The configure argument -qreal <type> maps to the CMake argument -DQT_COORD_TYPE=<type>. Fixes: QTBUG-83325 Change-Id: I94970f31ccfb241b1dd4f1d9b6cef25d6684dc05 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle -D, -I, -F and -L configure argumentsJoerg Bornemann2020-08-171-4/+4
| | | | | | | | | | | | | | Introduce new CMake variables and map -D to QT_EXTRA_DEFINES, -I to QT_EXTRA_INCLUDEPATHS, -L to QT_EXTRA_LIBDIRS, and -F to QT_EXTRA_FRAMEWORKPATHS. Those variables only affect the Qt build, not user projects. Fixes: QTBUG-85878 Change-Id: I229df2eed1505a2619068d0d32975962b052569a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Extend configure-cmake-mapping.mdJoerg Bornemann2020-08-131-44/+36
| | | | | Change-Id: Ie54b131c9a7b0f560fa735562fc4cbae4df35a49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Document the mapping of configure options to CMake argumentsJoerg Bornemann2020-07-021-0/+161
Add internal documentation how to map configure options to CMake arguments. This patch adds a markdown file with a giant table, and cmake/README.md links to it. Change-Id: I94a6a4ee24ed0114ccb3095d2c13cf5d84e2de72 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>