summaryrefslogtreecommitdiffstats
path: root/cmake/QtProcessConfigureArgs.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Map the 'verbose' configure option to CMakeAlexey Edelev2022-04-061-0/+2
| | | | | | | | 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>
* CMake:Android: Use ANDROID_PLATFORM instead of ANDROID_NATIVE_API_LEVELAssam Boudjelthia2022-03-111-2/+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: Don't escape backslashes in passed configure argumentsAlexandru Croitor2022-03-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It broke drive-less (no C:\ prefix) paths passed to configure. Invoking configure on Windows with the following args qtbase/configure -- -DCMAKE_INSTALL_PREFIX=\Users\qt\work\install called CMake with -DCMAKE_INSTALL_PREFIX=\\Users\\qt\\work\\install saying Qt will be installed into '//Users/qt/work/install' and while the build succeeded, installation would fail with CMake Error at cmake_install.cmake:41 (file): file cannot create directory: //Users/qt/work/install/lib/cmake/Qt6BuildInternals. Maybe need administrative privileges. Note the double slash in the beginning is likely interpreted as a Windows share URI / UNC path. The same would happen when passing -prefix '\Users\qt\work\install' As a reminder, we want to support drive-less prefix paths because that's what Qt's Coin CI uses passes to ensure DESTDIR installation works correctly. Amends cb7f4030bc89471aa6489be60ac1c728a3dfd06b Pick-to: 6.2 6.3 Fixes: QTBUG-94366 Change-Id: I9267b6f784babfbdaeafc65267ba96c75fa24112 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* configure: CMake: Add -no-prefix optionAlexandru Croitor2022-02-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* configure: Switch error to warning when -skip used in per-repo buildAlexandru Croitor2022-02-091-6/+4
| | | | | | | | | | | | | Yield a warning instead of an error that -skip and -submodules have no effect in a per-repo build. Amends acaba632605ac22aa3da4c3cf8e5891cb9cde657 Adjusts to 11ae0e772cccd3028771c1380f077c605224cc19 Pick-to: 6.2 6.3 Change-Id: Ic26b0ba29e48be5162f13ad75308f8358d8878e3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* configure: Raise error if -skip/-submodules is used in per-repo buildAlexandru Croitor2022-02-031-0/+10
| | | | | | | | | Specifying the options would do nothing, so it's better to error out early in case the developer accidentally added them. Pick-to: 6.2 6.3 Change-Id: Ia516468a22c3c48e9e84dc78e522e8870186d96b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* configure: Introduce -submodules optionAlexandru Croitor2022-02-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+15
| | | | | | | | | | | | | | | | 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>
* CMake: Fix detection of linker availabilityAlexandru Croitor2022-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | Previously we passed flags like -ld-fuse=lld only to compile calls, but not to the link call of a compile test project. Make sure to pass it to the link call instead by using check_cxx_source_compiles + CMAKE_REQUIRED_LINK_OPTIONS instead of check_cxx_compiler_flag. Note the flag that is passed is still via passed via the compiler launcher and not directly to the linker. Remove duplicate flag handling code. Pick-to: 6.2 6.3 Change-Id: I1bf90573904a9df83240b6debfee3cc9e425c6bb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Support configure -platform linux-clang-libc++Allan Sandfeld Jensen2021-12-141-0/+3
| | | | | | | | Detect libc++ config and add appropriate compiler and linker flags. Pick-to: 6.3 Change-Id: I9ec91b3ace987599d4e79e43b1b75aa67cd5caeb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Fix --foo=bar argumentsJoerg Bornemann2021-11-101-1/+1
| | | | | | | | | | This amends commit c5409964b0c627b25131c73f95794314feb51b5d. When detecting a variable assignment, we must ignore arguments that start with a dash. Otherwise, arguments like --prefix=~/Qt are ignored. Change-Id: I3b143113b94ca0d8af92679c1f567fbcec298349 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Allow specifying arbitrary variable assignmentsJoerg Bornemann2021-11-051-0/+13
| | | | | | | | | | | | | | It's now possible to call configure with arbitrary variable assignments "FOO=BAR" that get passed as "-DFOO=BAR" to CMake. There is no error anymore for unknown variables. CMake already warns about those: "Manually-specified variables were not used by the project: FOO". [ChangeLog][configure] Users can directly assign CMake variables with configure, for example "configure CMAKE_CXX_COMPILE=clang++-11". Fixes: QTBUG-88210 Change-Id: Ib15e63a895df717919dd2b6623fa4d284209776f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Remove unused facility to define variable assignmentsJoerg Bornemann2021-11-011-29/+0
| | | | | | | | | | | | The function qt_commandline_assignment and everything related to it is removed from configure. It was only used in qtbase, and all usage has been removed. More general variable assignments will be added in a subsequent commit. Task-number: QTBUG-88210 Change-Id: I7cfa782e89914f2b0dc0277c46e425c8a825557e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-3/+0
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add missing -help argument to qt-configure-moduleJoerg Bornemann2021-08-201-0/+22
| | | | | | | | | | | Now it's possible to display a configure help screen per module with qt-configure-module <module-source-dir> -help Pick-to: 6.2 Fixes: QTBUG-95943 Change-Id: I7d26006246af4b38b5a2ec6deca3f45c5313afec Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configure: Fix iOS option to be passed for both platform and xplatformAlexandru Croitor2021-08-171-1/+3
| | | | | | | Task-number: QTBUG-95838 Pick-to: 6.2 Change-Id: If0617e1d9c47595d4a350a91ab4f7d47546ebf08 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove unsupported host-related configure optionsJoerg Bornemann2021-07-061-14/+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>
* CMake: Propagate sanitizer flags to public projectsAlexandru Croitor2021-06-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Detect win32-msvc targetAllan Sandfeld Jensen2021-06-151-0/+3
| | | | | | | | Automatically set compilers based on old mkspec style target Pick-to: 6.2 Change-Id: I80404376964a85c6b519657c054d008da47aed91 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the win32-clang-msvc targetAllan Sandfeld Jensen2021-06-151-1/+4
| | | | | | | | Detect clang-cl mkspec target Pick-to: 6.2 Change-Id: If0ca31ae2da3b44a4e2bd116933007139cc02fdc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: fix CMake function qt_commandline_addStringHaoyu Liu2021-05-251-1/+1
| | | | | | | | | 1. a missing '}' breaks CMake 2. the variable "opt" should really be "arg", otherwise it'll be meaningless Pick-to: 6.1 Change-Id: If29557998bf7aa786dc5c821e2c55f1195e7922b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix developer buildJoerg Bornemann2021-05-101-0/+2
| | | | | | | | | The -developer-build had not the desired effect anymore. That argument must not be hidden from the feature logic. This amends commit d5c3e1336bc. Change-Id: I96562ea2df43ba7de002e705f28c7cc7edb4a589 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Allow to load -developer-build without configurations into an IDEKai Köhne2021-05-071-0/+12
| | | | | | | | | | | | | | | Let -developer-build, -cmake-file-api set up the CMake File API query, so that the build can be loaded directly into IDE's like Qt Creator. [ChangeLog][Build System] configure -developer-build now sets up the CMake File API query, so that a build can be loaded without reconfiguration into Qt Creator and other IDE's. Pass -developer-build -no-cmake-file-api to configure to disable this. Fixes: QTBUG-89487 Change-Id: I69199b8f96da02e42e5610aa6f49881c1582f7da Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add -write-options-for-conan configure argumentJoerg Bornemann2021-05-051-2/+78
| | | | | | | | | | | Passing this configure argument will generate a JSON file that contains information about configure options and features. This file is used by Qt's conan recipes. Fixes: QTBUG-92082 Change-Id: I2057ec8cbdb0a1ea198d7eeacb45f65bfa862d8a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Inhibit CMake generator detection for qt-configure-moduleJoerg Bornemann2021-04-261-1/+2
| | | | | | | | | | | | | | When configuring a Qt module with qt-configure-module, we want to use the same CMake generator that was used for building qtbase. That generator is encoded in qt-cmake-private. But qt-configure-module overrides the generator after trying to detect what generator should be used. That auto-detection is only useful for qtbase-builds and top-level builds. Turn it off for repo builds other than qtbase. Pick-to: 6.1 Fixes: QTBUG-91405 Change-Id: I07efb4afb51ba69d2f5467d272118fa51637ab54 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use bracket-based escaping for all list arguments in a configure stringAlexey Edelev2021-04-121-2/+2
| | | | | | | | | | | | | The 'list(TRANSFORM cmake_args REPLACE "\\[\\[;\\]\\]" "\\\\;")' call breaks the list arguments added when evaluating the 'INPUT_' values. Therefore, it's necessary to apply bracket-based escaping to all list arguments instead of the standard escaping. Amends 856fadf85ca2a3b70878d01d32e4d4cef807b8a9 Fixes: QTBUG-92459 Change-Id: Ifd4e0ca5f549a1c7fab9ceb587ed355250c4e677 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Build minimal subset of tests in desktop static buildsAlexandru Croitor2021-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Add new configure option -make minimal-static-tests and CMake option QT_BUILD_MINIMAL_STATIC_TESTS. In conjunction with QT_BUILD_TESTS it will enable building a minimal subset of tests when targeting a static desktop Qt build. In qtbase the minimal subset includes all the auto tests of testlib, tools, corelib and cmake. In particular this will also do cmake build tests and qmake build tests (tst_qmake) Adjust CI instructions to enable building a minimal subset of static tests when a platform configuration is tagged with the MinimalStaticTests feature. Fix and skip a few tests that were failing. Pick-to: 6.1 Task-number: QTBUG-87580 Task-number: QTBUG-91869 Change-Id: I1fc311b8d5e743ccf05047fb9a7fdb813a645206 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make find_package in configure.cmake a hard errorJoerg Bornemann2021-03-311-0/+5
| | | | | | | | | | | | | | | qt3d/9a473a3c9b246f4895ae73d7060745b8b199a6c5 introduced a find_package call in a configure.cmake file, very subtly breaking top-level builds with configure. The find_package call results in errors of the cmake call that runs QtProcessConfigureArgs.cmake (see bug report for details). Create a find_package stub that errors out with a helpful message. Task-number: QTBUG-92163 Change-Id: I06db0bf219b965e93b78c690e9f7ad868196ddb9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix processing of list arguments passed to the 'configure' scriptAlexey Edelev2021-03-301-3/+11
| | | | | | | | | | | | | | | | list(TRANSFORM ...) unexpectedly removes semicolon escaping in list items. So the list arguments seems to be broken. The 'bracket argument' suppresses this behavior. Right before forwarding command line arguments to the cmake call, 'bracket arguments'are replaced by escaped semicolons back. Recent fix escapes all semicolons of the 'configure_args' and glues all arguments to a single 'list'. Amends df8e1c8e588cb0529b2bc02faef1022ef3f29145 Change-Id: I4a458b9e3add307b36924c4c7c7f739d348f9343 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Handle arbitrary configure arguments that contain listsTor Arne Vestbø2021-03-231-2/+4
| | | | | | | | | Passing e.g. -- -DQT_BUILD_SUBMODULES="qtbase;qtdeclarative" to configure would fail because the module list was not preserved as a single argument. Change-Id: If685d0d541201597a2c2a5dc3d55b5d1ae51da22 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix configure build due to use of qt_set01 in configure.cmakeNiclas Rosenvik2021-03-171-0/+1
| | | | | | | | | | | The change "Enable X11 on other platforms than just Linux" uses qt_set01 in a configure.cmake file but does not add it to the stubs list in QtProcessConfigureArgs.cmake thus breaking builds based on configure. Add a defstub with qt_set01 to fix this. Change-Id: Ia3e0ec61df5228f88f77f631968f6f96d567ec8e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove the -qmake and -cmake configure argumentsJoerg Bornemann2021-03-111-3/+1
| | | | | | | | | | Qt is built with CMake since 6.0 and the QMake build system was removed in 6.1. It's time to remove the -cmake and -qmake configure arguments for Qt 6.2. Fixes: QTBUG-88286 Change-Id: Ie726ec364ded025f8d93bd69b469561a6ae40aa9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add QT_CONFIGURE_RUNNING variable for configure.cmake filesJoerg Bornemann2021-03-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | configure.cmake files are read twice when using the configure script / qt-configure-module: First, when configure is running and a second time, when CMake creates the local build system files. In the first run, not every function and esp. no targets are available. Code in configure.cmake that accesses targets or calls functions unknown to configure will fail at the configure stage. This patch introduces the QT_CONFIGURE_RUNNING variable that can be used in configure.cmake files to guard such code: if(QT_CONFIGURE_RUNNING) set(_qt_coord_type double) else() get_property(_qt_coord_type TARGET Qt6::Core PROPERTY INTERFACE_QT_COORD_TYPE) endif() Change-Id: Iff39924d6a5133379d28c8204d7b7afdf47de5c8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Do not rewrite boolean INPUTs if they have a corresponding featureAlexey Edelev2021-02-181-12/+0
| | | | | | | | | | | | | | | | | | | Initial replacement of boolean INPUT_ variables to the FEATURE_ variables was wrongly changed to updating of the INPUT_ variable value to ON/OFF value. This causes potential issues when INPUT_ variable has explicit check for 'yes' or 'no'. The feature evaluation step enables FEATURE_ variables in case if the corresponding INPUT_ variable contains a positive CMake value. So there is no need to process boolean INPUTs at the argument processing step. Also no need to keep the special opengl case, since it will be processed correctly. Fixes: QTBUG-91158 Pick-to: 6.0 Pick-to: 6.1 Change-Id: I96bb7903a904ae3cf788d7ef7d4e0c019046eb95 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* configure: Don't guess the compiler if the user already chose oneJoerg Bornemann2021-02-111-4/+41
| | | | | | | | | | | | We must not guess the compiler from the -platform argument if one of the following holds: - the CXX/CC environment variables are set - the CMAKE_CXX_COMPILER/CMAKE_C_COMPILER variables are passed Pick-to: 6.1 Fixes: QTBUG-90914 Change-Id: Iff7a0e7b8857f77333f1705f118d7952af5234ba Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* configure: Fix handling of -translationdir argumentJoerg Bornemann2021-02-081-1/+2
| | | | | | | | | | This is supposed to be mapped to INSTALL_TRANSLATIONSDIR, not INSTALL_TRANSLATIONDIR (without the s). Pick-to: 6.0 6.1 Fixes: QTBUG-90946 Change-Id: Icec93ffc0dc80d9ac7cf6cf1b13824bc2a1e795f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Add proactive check of generator multi-config capabilitiesAlexey Edelev2021-01-051-0/+10
| | | | | | | | | | Add explicit error, if multi-config build is requested, but selected generator doesn't support it. Fixes: QTBUG-88287 Pick-to: 6.0 Change-Id: I6dba589bb59ad69fa07221c657df272ec75c359b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add extra targets to run single benchmark using CMake generatorAlexey Edelev2020-12-071-27/+26
| | | | | | | | | | | | | | | | | | Add custom targets with '_benchmark' suffixes to make run of benchmarks using generators possible, e.g.: $ ninja tst_bench_qudpsocket_benchmark Extend '-[no]make' option to pass benchmark. Rework '-[no]make' processing to unify these options processing. Also looks like it doesn't make sense to enable benchmarks without having test enabled. So '-DQT_BUILD_BENCHMARKS' enables test as own dependency automatically. Task-number: QTBUG-89076 Pick-to: 6.0 Change-Id: Ieee9eadaf6d75a1efec120242d6eb786ace1b071 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: Fix configure not to pass clang compilers for AndroidAlexandru Croitor2020-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | That breaks configuration with CMake version 3.18.x (but not 3.19 for some reason). Specifically configure ends up passing -DCMAKE_CXX_COMPILER=clang++ which overrides the compiler set by the CMake Android toolchain file, and at the very end of CMake's configuration it complains about You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= clang++ Which suddenly starts another configuration with the modified compilers, ends up detecting host compilers and libraries and basically everything breaks apart. Fix QtProcessConfigureArgs.cmake not to pass the compiler options if the mkspec contains 'android'. Who knows, we might need this for other platforms too at some point. Task-number: QTBUG-88460 Change-Id: Idd57870a7cb1009a4e7802e5b3d5ac735f2dacf6 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Add special processing of opengl configure optionAlexey Edelev2020-11-121-0/+5
| | | | | | | | | | Since feature evaluation expects explicit 'no' value for INPUT_opengl to disable either desktop or es2 opengl support, add special processing for -no-opengl option into QtProcessConfigureArgs.cmake Task-number: QTBUG-88142 Change-Id: Ib49123ee3e9f98035f6ec85a182382559f4db478 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix configure arguments handlingAlexey Edelev2020-11-121-1/+1
| | | | | | | | | | All configure arguments should be processed as strings and not be ignored if they satisfy CMake's FALSE criteria (see https://cmake.org/cmake/help/latest/command/if.html) Fixes: QTBUG-88424 Change-Id: I932038ad3c5999bed58957dec51fbf892bd650d7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Map configure -hostdatadir to INSTALL_MKSPECSDIRJoerg Bornemann2020-11-101-0/+6
| | | | | | | | | | 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: Implement configure -list-featuresJoerg Bornemann2020-11-101-0/+26
| | | | | | | | | Extend qt_configure_get_padded_string to make the feature list look like qmake's. Fixes: QTBUG-88144 Change-Id: I714f2b2f3537b506365a03b5b6bc3413e9cab167 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make Release the main config of a -debug-and-release buildJoerg Bornemann2020-11-101-1/+1
| | | | | | | | In configure we need to set the Release configuration first to make it the main configuration. Change-Id: I5fe744b0dcea009c4d672bf519b38c80c87475dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add quotes to cmake_args in guess_compiler_from_mkspec functionDavid Skoland2020-11-041-1/+1
| | | | | | | | These were omitted in the original change, which cause cmake builds to fail configuring Change-Id: I37996099aaa0d912ce06b1f06c175cc5cf159e33 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add handling of user-defined INPUT_foo cache variablesAlexey Edelev2020-11-031-1/+1
| | | | | | | | | | | | "configure" script translates feature-related parameters to INPUT_ variables instead of FEATURE_. Both INPUT_ and FEATURE_ variables passed to cmake script are equivalent. FEATURE_ has higher priority in case if both are defined. Fixes: QTBUG-87755 Change-Id: If697a0d62ab839877a3196ea74e631582a570dda Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Let configure guess the compiler from mkspec argumentJoerg Bornemann2020-11-021-0/+20
| | | | | | | | | | | | The arguments -platform, -xplatform and -device determine the mkspec that's used for the qmake companion files. If the user specifies a mkspec that indicates usage of clang or icc, set the respective CMake variables to use one of those compilers. Fixes: QTBUG-87836 Change-Id: I2b10d819b0eb92a97d7f79672547b1e2d821cf33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix [qt-]configure[-module].bat arguments with backslashesJoerg Bornemann2020-10-301-0/+2
| | | | | | | | We must escape backslashes in CMake code that's to be evaluated and in the arguments we read from config.opt. Change-Id: I65d033c77f71888974983aa3d834acb2fe89f3fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix CMake generator auto-selection on WindowsJoerg Bornemann2020-10-221-1/+1
| | | | | | | The variable to check for a Windows host system was mis-typed. Change-Id: I25b14b80d25bfec0c1a00e99833520b6fb6a4b02 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>