summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Fix plugin target names to be compatible with Qt 5Alexandru Croitor2020-01-271-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, qmake generates CMake Config files which expose the plugins as imported libraries. The name of these libraries are derived from the plugin class name. So QCocoaIntegrationPlugin, and not qcocoa. To keep compatibility between Qt5 and Qt6 CMake target names, the pro2cmake script should generate plugin target names based on the plugin class names. To avoid passing the same name in qt_add_plugin (target and CLASS_NAME), derive the class name from the target if the class name is not explicitly specified. Also add a new OUTPUT_NAME parameter which is used to change the final file name of the plugin, so that it's compatible with Qt5. For example to generate a qcocoa.dylib file, instead of QCocoaIntegrationPlugin.dylib file. The same OUTPUT_NAME value will be used for generation of plugin .prl files for qmake consumption. Change-Id: I4d53e680d7beb62befecd359cdf6bba60a34ff0d Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add initial support for CMake "Ninja Multi-Config" generatorAlexandru Croitor2020-01-277-9/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows doing debug_and_release builds with Ninja on all platforms. The "Ninja Multi-Config generator" is available starting with CMake 3.17. Desired configurations can be set via CMAKE_CONFIGURATION_TYPES. Possible values: "Release, Debug, RelWithDebInfo, MinRelSize". For example -DCMAKE_CONFIGURATION_TYPES="Release;Debug". The first configuration is the 'default' configuration which is built when calling ninja with no arguments. To build all targets of a certain configuration use "ninja all:Release" or "ninja all:Debug". To build all targets in all configurations use "ninja all:all". Note that the first configuration influences which configuration of tools will be used when building the libraries for all configurations. In simple terms, when configured with -DCMAKE_CONFIGURATION_TYPES="Release;Debug" the release version of moc is used by AUTOMOC. When configured with -DCMAKE_CONFIGURATION_TYPES="Debug;Release" the debug version of moc is used by AUTOMOC. Framework builds and Ninja Multi-Config don't currently work together due to multiple bugs in CMake, which ends up generating an invalid ninja file with duplicate rules. There are also issues with placement of the debug artifacts. This will be handled in a follow up patch after CMake is fixed. Task-number: QTBUG-76899 Change-Id: If224adc0b71b7d1d6606738101536146aa866cd7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Support for QML Type RegistrarLeander Beernaert2020-01-241-71/+7
| | | | | Change-Id: Ifc1f44cf40b22c20ab768333ba9d5ce58a5f7250 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix dependencies for SIMD object libraries in macOS framework buildsAlexandru Croitor2020-01-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This manifested in Coin when ninja tried to build qdrawhelper_sse2.cpp before the Core framework headers were copied, resulting in a fatal error: 'qatomic.h' file not found. Make sure every SIMD object library has all PRIVATE dependencies of its parent library PRIVATE dependencies (except for other SIMD object libraries), to make sure that the framework headers are copied by the time the SIMD source file is compiled. Here's an example for clarification. Gui_simd_sse2's LINK_LIBRARIES property should have all the values of Gui's LINK_LIBRARIES property (like Qt::Core) filtering out all SIMD object library targets ( like Gui_simd_sse2, Gui_simd_sse3, etc). Thus we make sure the SIMD object libraries are built after Gui's dependencies are built. Note that using INTERFACE_LINK_LIBRARIES to avoid the filtering of SIMD targets in the generator expression would only work in shared Qt builds. In static Qt builds where PRIVATE dependencies become PUBLIC, CMake would insert $<LINK_ONLY:Gui_simd_foo> entries in INTERFACE_LINK_LIBRARIES which causes CMake to be confused and fail at generation time. Change-Id: I246c1394b9c9830c0ebd11e6621e56b992a6a1f2 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add QT_TEST_RUNNING_IN_CTEST environment variable for testLeander Beernaert2020-01-141-1/+1
| | | | | | | | | | | | | When running tests with CMake's CTest, set the environment QT_TEST_RUNNING_IN_CTEST to 1. This can be useful to deal with tests that do not properly work when running from CTest. For instance, the qmake test in this patch has one test that only works when not run from CTest. Change-Id: I01eea9131de69c18118a9ed9f96e9296d5ea20f1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for test timeoutsLeander Beernaert2020-01-131-1/+4
| | | | | Change-Id: Iba805cbc16d179e5b080ccc00542329270075aa1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Generator Expression for static non-prefix buildsLeander Beernaert2020-01-101-1/+1
| | | | | Change-Id: Icd32164943d7bb0639de3022bae749d0010674fc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement qtbase fixes for superbuildsJean-Michaël Celerier2020-01-0810-79/+165
| | | | | | Change-Id: I0d3445cf0740e3925fa9342dac4d07892518afe5 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix is_framework check for interface librariesLeander Beernaert2020-01-061-1/+6
| | | | | | Change-Id: I59832e698eceb98a2a03f4a3e2de88b1d18fda6e Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Add support for framework buildsJoerg Bornemann2020-01-061-36/+201
| | | | | | | | | | Framework builds are enabled by default on macOS. They are controlled via the framework feature. Task-number: QTBUG-75751 Change-Id: I00bc64672f02bbd1672508b2b5010d202984a961 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot
* Add custom targets for documentationLeander Beernaert2019-12-182-1/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds custom targets which take care of generating and installing documentation files. Every module has a global set of targets suffixed with the module name in order for them to be unique when we implement super builds. The targets are the same as the list below, but replace ${target} with the module's name. Eg.: docs_qtbase. For every target which has an qt_add_docs() call, we now create the following set of custom targets: * docs_${target} * html_docs_${target} * qch_docs_${target} * prepare_docs_${target} * generate_docs_${target} * install_docs_${target} * install_html_docs_${target} * install_qch_docs_${target} Fixes: QTBUG-75859 Change-Id: Ie84cb9a2dedbe7333d9a84f4d73383442deca477 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Expose Patch Version in QtConfig.cmakeLeander Beernaert2019-12-112-3/+6
| | | | | Change-Id: I2166d480c0b717fc9137f8eb42d5aab7a091395d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add option to specify working directory for qt_add_testLeander Beernaert2019-12-101-2/+8
| | | | | | Change-Id: Iba5104cccdc613f7b2cf0d1454209578adaac824 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake/README.md: Clarify some pointsFriedemann Kleint2019-12-091-4/+6
| | | | | | | | | - Mention location of the configure.cmake - Specify the path to the conversion scripts Change-Id: Ia6e13a1f4d2c29f2fbaf35acdd70ab16c7175d37 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure to install QtModuleToolsVersionlessTargets.cmake.inAlexandru Croitor2019-12-061-0/+1
| | | | | | | | | | | | Amends 04d895681adab24829be44c392534bcbe9d6c106 Task-number: QTBUG-74137 Task-number: QTBUG-80477 Task-number: QTBUG-75984 Change-Id: I617c2abf421bc1378545e5a36fd44533131ef471 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix creation of versionless targets for toolsAlexandru Croitor2019-12-065-7/+47
| | | | | | | | | | | | | | | | | | We can't use qt_internal_export_modern_cmake_config_targets_file for executables like tools, because it's not possible to use INTERFACE_LINK_LIBRARIES with executables like you can with libraries. We also can't create aliases to non-global imported targets. Instead create new imported executable targets, fish out the imported location, and assign it to the versionless targets. Task-number: QTBUG-74137 Task-number: QTBUG-80477 Task-number: QTBUG-75984 Change-Id: I6a3c9c67ef4699c72a6c9a627c63158dfd6557f8 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix meta types json file install for non-prefix buildsLeander Beernaert2019-12-051-1/+10
| | | | | Change-Id: I76fd379dacb7db79d4ed6ca47954ae8e703842d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Clear QT_KNOWN_MODULE_${module}_TOOLS cache vars on reconfigurationAlexandru Croitor2019-12-051-0/+2
| | | | | | | | | | Otherwise if you configured a commit that has tool A, and the switch to a commit where tool A does not exist anymore, reconfiguration will fail. Change-Id: Ibb244b9630a6f4fecd27d51ce28eceff07ba8666 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Collect Json Metatypes from CMake's AutomocLeander Beernaert2019-12-041-1/+14
| | | | | | | | | | | | | | | | | | | | This patch adds a new bootstrap tool which will read CMake's AutoGenInfo.json and ParseCache.txt to determine what the current list of json files is that needs to be passed to moc --collect-json option. Right now this is enabled for qt_add_module() with the option GENERATE_METATYPES. pro2cmake has also been updated to detect qmake's CONFIG += metatypes and to generate the above option for modules. The implementation lives in Qt6CoreMacros so it can eventually be used in the public facing apis. The generated meta types file is saved under the target property QT_MODULE_META_TYPES_FILE. Change-Id: I03709c662be81dd0912d0068c23ee2507bfe4383 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't export private include paths if there are no private includesAlexandru Croitor2019-12-031-3/+6
| | | | | | | | | | | | Needed when building Qt Creator with CMake + Qt6 non-prefix build. Specifically qttools's QtUiPlugin does not have any private headers, but the non-existing include path was exported, which caused an error when configuring Qt Creator. Change-Id: I662bc502fe3134fba083bde273b7f63fe1470277 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Export non-private and non-public features and CONFIG valuesAlexandru Croitor2019-12-031-1/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before we only exported features that had outputType PUBLIC or PRIVATE on the various "QT_ENABLED_PUBLIC_FEATURES" target properties. Now we also export features that have output type privateConfig, publicConfig and publicQtConfig. The new properties names are: - QT_QMAKE_PUBLIC_CONFIG for outputType == publicConfig - QT_QMAKE_PRIVATE_CONFIG for outputType == privateConfig - QT_QMAKE_PUBLIC_QT_CONFIG for outputType == publicQtConfig These need to be exported for 2 reasons: - other modules that need to check the config values - in preparation for generating proper qmake .prl and .pri information for each module Note that the config values are now considered actual features when doing condition evaluation. So if there exists a feature "ssse3" with outputType privateConfig, its enabled state can be checked via QT_FEATURE_ssse3 in consuming modules (but not in the declaring module). These config values are also placed in the respective QT_ENABLED_PUBLIC_FEATURES, QT_ENABLED_PRIVATE_FEATURES properties when exporting a target, so the properties will now contain both features and config values. In order to make this work, feature name normalization has to happen at CMake time, rather than done by the python script. This means that features like "developer-build" need to retain the dash in the qt_feature(), qt_feature_definition() and qt_feature_config() calls, rather than generating "developer_build" as the script did before. The normalization is done at CMake time. Feature conditions, CMake code, and -DFEATURE_foo=bar options passed on the command line should still use the underscore version, but the original name is used for the QT_QMAKE_PUBLIC_CONFIG properties. Note that "c++11" like features are normalized to "cxx11". Implementation wise, the configurejson2cmake script is adjusted to parse these new output types. Also QtBuild and QtFeature are adjusted to save the config values in properties, and re-export them from GlobalConfig to Core. Task-number: QTBUG-75666 Task-number: QTBUG-78178 Change-Id: Ibd4b152e372bdf2d09ed117644f2f2ac53ec5e75 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add initial support for cross-building to iOSAlexandru Croitor2019-12-0311-29/+332
| | | | | | | | | | | | | | | | | | | | | | Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Cache qt_config_compile_test resultsAlexandru Croitor2019-12-021-0/+4
| | | | | | | | | | | | | | | | Inside qt_config_compile_test we use two different calls: check_cxx_source_compiles when given code, and try_compile when given a project. The former caches its results, while the latter does not, which means that the try_compile calls are re-executed on each reconfigure. Do what check_cxx_source_compiles does internally, and don't rerun the try_compile calls if the results were computed once. Change-Id: I2691ff08b7bb46c3fa60bbf5ed6278731c9b8e21 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Provide a way to specify extra tool package dependenciesAlexandru Croitor2019-11-263-21/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the qtwayland repo, both WaylandClient and WaylandCompositor packages need access to the qtwaylandscanner tool. That means that the add_qt_tool(qtwaylandscanner) can't use the TOOLS_TARGET argument to associate a dependency with only one of the above modules. Instead add_qt_tool now allows specifying a non-existent module name for the TOOLS_TARGET argument, which can be manually depended on by other packages. Actually, you could specify the non-existent module before as well, but that didn't do everything that had to be done. This required a bit of refactoring in how the Dependencies file for Tools packages is created. Now the file is created in qt_export_tools. Two new functions were also added to allow recording additional dependencies between packages. Also some bug fixes were done to make it all work. Specifically the _FOUND variable generated in the Dependencies file was incorrect. Also there are some quotes missing when appending extra package dependencies via the QT_EXTRA_PACKAGE_DEPENDENCIES property. Change-Id: I167efec16dff8d036e191df3572ea72764e22bc5 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add FindWrapHarfbuzzAlexandru Croitor2019-11-251-0/+45
| | | | | | | | | | Apparently we didn't have a wrap find module for it before. Add one, and add special support to handle a Gentoo broken Config file which is exported by an autotools build of harbuzz. Change-Id: I83cbeb817caf2610104c16713d4eac6ab6f8c63b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* CMake: Do feature testing for linker flagsCristian Adam2019-11-221-3/+16
| | | | | | | | | Instead of hardcoding which platforms and which compilers support certain linker features, do the proper probing via check_cxx_source_compiles. Change-Id: I676010970d8f3a8f2a8340c5d15dfcef76fe9191 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add support for building with Clang-MinGW toolchainCristian Adam2019-11-221-2/+5
| | | | | | | | Clang doesn't have a mkspec just a win32-clang, there is win32-clang-g++ and win32-clang-msvc. Change-Id: Iff521e955559dfb2308e377b41e86b3f62c42e70 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix an incorrect regex rangeJean-Michaël Celerier2019-11-221-2/+2
| | | | | Change-Id: I1b8b72cb4adcd872a3e4c245e58d4e302bf00c86 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix warnings when a module's plugin type has underscoresAlexandru Croitor2019-11-151-3/+9
| | | | | | | | | | | | | | | | In qtwayland, there were a bunch of warnings of the following type when configuring: "The plug-in 'f' does not belong to any Qt module". This happened because the plugin type had underscores, and was not sanitized when comparing a the plugin type of plugin. Add a function to do the sanitization, and use it everywhere. Change-Id: I728b5f1e18fa5f8876c4a57dbd4e33148cb242d5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix add_cmake_library to use a correct plugin suffix on macOSAlexandru Croitor2019-11-151-0/+6
| | | | | | | | | | Qt plugins on macOS use .dylib, whereas CMake created used ".so" instead. Change-Id: I3ea73a52a0675a0cfce4997ca413df79e63cfaa7 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Rename / prefix all our private API functions with qt_Alexandru Croitor2019-11-146-137/+194
| | | | | | | | | | | Rename internal APIs like extend_target to qt_extend_target. Prefix apis with qt_ where required. Keep old names for compatibility until all their usages are removed. Change-Id: I9a13515a01857257a4c5be3a89253749d46a4f41 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix not to add warnings_are_errors property to INTERFACE targetsAlexandru Croitor2019-11-131-0/+4
| | | | | | | | | Amends f00068561287e64c8c664ee1af3feff08b22b669 Change-Id: I3b61b64bb9c755de38f4a5ffcb07b39b38bd4fd7 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Always build tests by default when building standalone testsAlexandru Croitor2019-11-131-0/+4
| | | | | | | | Amends 021c17c62f963a682c6a4b19f0c3d362c28a97ee Change-Id: I8181270ef7506eb5da4d3b43e105e100ed5581e4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't include standalone tests config file if none existsAlexandru Croitor2019-11-131-1/+1
| | | | | | | | | | | Some repos like qtimageformats don't generate a config file for standalone tests because the repo creates no modules. Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Change-Id: Id42338804605a883f975feb5dd81eda5acc6e687 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix qt_skip_warnings_are_errors_when_repo_unclean for executablesAlexandru Croitor2019-11-131-1/+1
| | | | | | | | Amends f00068561287e64c8c664ee1af3feff08b22b669 Change-Id: I48d7a42e11e609fa3a387b7669ee96bd10c856e4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for skipping warnings are errorsAlexandru Croitor2019-11-122-9/+27
| | | | | | | | | | | | | | | | | | | Unfortunately not all repositories are marked as warning_clean in their .qmake.conf files. For instance qtconnectivity and qttools are not warning clean. Therefore we need to skip warnings_are_errors flags on all targets created in that repository. Add support for skipping the warnings are errors flags, by setting a QT_SKIP_WARNINGS_ARE_ERRORS property on a target, and use that within a generator expression with all the accumulated flags. To mimic behavior of qmake, and set the property on all targets created by add_qt_module, add_qt_plugin, etc, one simply needs to set the QT_REPO_NOT_WARNINGS_CLEAN variable in the repo project CMakeLists.txt. Change-Id: Ib5a487af6601ae1519a0988a89f8083f94f92267 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add add_qt_manual_test()Leander Beernaert2019-11-121-0/+34
| | | | | | | | | | | This patch adds add_qt_manual_test() which is a simple wrapper around add_qt_executable() which does not build under ${CMAKE_BUILD_DIR}/bin or install the targets. This could potentially be used later to tag manual tests. Change-Id: Ic4e0a1d133009f5a858b9394347a0996cf42683f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't install QtFooTestsConfig.cmake if no modules were builtAlexandru Croitor2019-11-121-0/+6
| | | | | | | | | | | | | | | When configuring qtx11extras on macOS, we ended up installing the file, which made Coin think that at least one module was built, and thus it tried to build tests as well. Don't install the file if no modules were built, thus preventing from trying to build tests in Coin. Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Change-Id: I920a0b40a6ded12140f251352da53b68eef6560d Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make sure to install QtStandaloneTestsConfig.cmake.inAlexandru Croitor2019-11-121-0/+1
| | | | | | | | | Otherwise leaf modules fail to configure. Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Change-Id: Ie304c0021ada9911044abdb7e460b8da8e986a8f Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build test/manual if it contains a CMakeLists.txtLeander Beernaert2019-11-121-0/+3
| | | | | | | Change-Id: Ibada60b0902f9c6a6a7284489a56106e0021a9de Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix armv7 embedded Linux buildSimon Hausmann2019-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | In gui's CMakeLists.txt we have if (NOT ANDROID) ... add_qt_simd_part(Gui SIMD neon SOURCES ...) ... endif() and later if(UNIX AND NOT ANDROID AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64")) add_qt_simd_part(Gui SIMD neon endif() Since add_qt_simd_part internally uses an OBJECT library to compile the sources with different flags and then link into Gui (in this case), we may end up with an error when add_qt_simd_part is called twice for neon, because the constructed target (Gui_simd_neon) exists already. We can re-use an existing target though, as the SIMD features is the same. Change-Id: I7a21c6e66b47e918a53fa3b1a7db9e053ecc8d87 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix architecture config tests values to be written only onceAlexandru Croitor2019-11-082-6/+7
| | | | | | | | | | | | | | | | Every time the qtbase project was reconfigured, the list of config tests results was appended to a cache variable which was never reset, resulting in multiple copies of the same values being written to QtBuildInternalsExtra.cmake. Make sure to clean the cache variable before appending to it. Also change the variable to be all upper-case, to be consistent with other cache variables. Change-Id: Ic12046730a080595e19377981a726bc330641dc1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for -nomake-tests and -nomake-examples equivalentsAlexandru Croitor2019-11-083-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A developer can pass either -DQT_NO_MAKE_TESTS=ON or -DQT_NO_MAKE_EXAMPLES=ON to exclude tests or examples from being built as part the default make target (when you write just make or ninja). With ninja, tests and examples can be built separately one by one, by typing $ ninja tst_foo or $ ninja example_bar Same can be done with the Makefile generator. $ make tst_foo All tests / examples can be built in one go by typing $ ninja tests/all or $ ninja examples/all With the Makefile generator unfortunately it's not as nice and is most likely an implementation detail, but it can still be done by running something like $ make -f CMakeFiles/Makefile2 tests/all or $ make -f CMakeFiles/Makefile2 examples/all Change-Id: I34f168b3ab41e952a21d3ace5634e25a9f41922e Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make standalone tests build via top level repo projectAlexandru Croitor2019-11-085-42/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously repo/tests/CMakeLists.txt was a standalone project on which CMake could be called. This was useful for Coin to be able to build and package only tests, but was a bit troublesome because that means having to specify the usual boilerplate like minimum CMake version, which packages to find in every tests.pro project. Instead of having a separate standalone project, modify the top level project and associated CMake code to allow passing a special QT_BUILD_STANDALONE_TESTS variable, which causes the top level project to build only tests, and find Qt in the previously installed qt location. This also means that when building a repo, we generate a ${repo_name}TestsConfig.cmake file which does find_package on all the modules that have been built as part of that repo. So that when standalone tests bare built for that repo, the modules are automatically found. qt_set_up_standalone_tests_build() is modified to be a no-op because it is not needed anymore. Its usage should be removed from all the other repos, and then removed from qtbase. Non-adjusted tests/CMakeLists.txt projects in other repositories should still be buildable with the current code, until they are updated to the new format. Adjust the Coin build instructions to build the standalone tests in a separate directory. Adjust pro2cmake to generate new structure for the tests/tests.pro projects. Adjust the qtbase tests project. Fixes: QTBUG-79239 Change-Id: Ib4b66bc772d8876cdcbae1e90ce5a5a5234fa675 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix handling of _nolink targets for the QtNetwork moduleAlexandru Croitor2019-11-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | When a _nolink target is exported, instead of getting the original namespace prefix, it gets the Qt6 prefix (OpenSSL::OpenSSL_nolink -> Qt6::OpenSSL_nolink). There is some special case code in Network autotests which tries to access the former target name, which doesn't exist when building standalone tests. Make sure to create a Qt6:: library alias for _nolink targets during a build (so before the library is exported), and change the Network autotests project to use this Qt6:: namespaced library, which will ensure it is found both in a standalone tests build and in a regular Qt build. Also make sure to actually call find_package to find the OpenSSL library when building standalone tests, otherwise configuration will fail. Change-Id: I3da5b958e72e745a50380f8ab1644459a7c6b005 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix interface library issues on AndroidAlexandru Croitor2019-11-082-1/+5
| | | | | | | | | | | Don't call qt_android_dependencies for interface libraries. Also make sure not to set properties which don't start with INTERFACE_ prefix. Change-Id: I0afdffd34c9aebe0d7ac4731b57dd4d505f84570 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Don't add linker scripts to interface librariesAlexandru Croitor2019-11-081-4/+6
| | | | | | | | | It only makes sense for non-interface libraries. Change-Id: I80ac942ed546a6ac866e827aa2026e4e6ac897b2 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Don't query MODULE_PLUGIN_TYPES property on interface librariesAlexandru Croitor2019-11-081-3/+7
| | | | | | | | | | | | | The reason is that interface libraries have to have properties prefixed with INTERFACE_ and more importantly we don't set the property for interface libraries at the moment. Amends d1542e8a73f535011d42970cc5b1b28a414c14c9. Change-Id: I86bf99995278b9086fa0e3815e10d5d54d9ea4dc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix Android x86 buildsLeander Beernaert2019-11-081-0/+9
| | | | | | | | | | | | Replace condition x86 to i386 to match other platforms. Regenerate src/gui/CMakeLists.txt Disable SSE4 on android x86 to match qmake. Change-Id: Ic0d330206f2d70a79d72553aa3ff0f91ff58119c Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for benchmark conversionLeander Beernaert2019-11-043-1/+44
| | | | | | | | | | | | | Convert benchmark executables to add_qt_benchmark(). Currently add_qt_benchmark just calls add_qt_executable() and ensures that it they build under CMAKE_CURRENT_BUILD_DIR and do not install. Add QT_BUILD_BENCHMARKS option to enable/disable building of benchmarks. Change-Id: Id0bc676698d21d50048d97d9abef51d92ccb6638 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>