summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6CoreMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix dependency in qt_add_big_resourcesKai Koehne2020-07-081-1/+1
| | | | | | | | | | | | Ensure that the second rcc pass is executed whenever the object file changes. Patch provided by Hongpeng Liu <lhpzwd@163.com> Fixes: QTBUG-85186 Pick-to: 5.15 Change-Id: I6e52ec15048ab286efd85500ca535b2b8b01c270 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Apply symbol visibility settings to Objective-C/C++ sourcesTor Arne Vestbø2020-06-251-0/+2
| | | | | | | | | | | | | | | Otherwise the Objective-C++ sources will be built with the default compiler visibility (visible), and then linked with moc-generated C++ sources that have the Qt overridden hidden visibility, resulting in linker warnings such as: ld: warning: direct access in function 'X' from file 'moc_foo.cpp.o' to global weak symbol 'Y' from file 'bar.mm.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility setting Change-Id: I22e15e7e181a74de8c0a22c73d06e600e582d7fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Write object libs of Qt resources to .prl filesJoerg Bornemann2020-06-161-0/+1
| | | | | | | | | | | | | | | Since commit e343affd634 we're creating object libraries for Qt resources in static libraries. Those must be reflected in the generated .prl files for static builds of Qt. In qt_add_resource, we now calculate the install locations of the object files of rcc-generated C++ files and save them in the target property QT_RCC_OBJECTS. This property is then passed to QtFinishPrlFile to write the object file paths to the .prl file. Change-Id: Ic383892d723d02fc91f712bc2dbcbc90babad074 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Check CMAKE_CONFIGURATION_TYPES when doing automoc extractionAlexandru Croitor2020-05-291-1/+1
| | | | | | | | | | Otherwise when configuring a standalone example without specifying a CMAKE_BUILD_TYPE (so it's empty), building fails because qt6_generate_meta_types_json_file thinks it's being called with a multi-config generator. Change-Id: I360c7dbb19522155d8e72f98836fb663916715a0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use default location for installing metatypes json filesAlexandru Croitor2020-05-291-47/+66
| | | | | | | | | | | | | | | | | | | | | Previously configuring a standalone example that had no explicit INSTALL_DIR option for qt6_generate_meta_types_json_file would fail. When no explicit location is specified to qt6_generate_meta_types_json_file via INSTALL_DIR option, default to installing into a lib/metatypes location relative to the install prefix. This is required for supporting calling qt6_generate_meta_types_json_file when building standalone applications or libraries (not part of the Qt build). Make sure not to install the metatypes.json file for executables. Install it only for libraries (aka modules). Task-number: QTBUG-84403 Change-Id: Ie0dd75fca0cde71ccb4eb48030871e72d31d1725 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake Build: Do not set "lib" prefix for modules (plugins)Cristian Adam2020-05-291-0/+4
| | | | | | | CMake sets "lib" as default prefix for Windows-GNU platforms. Change-Id: I49e3123c385610307c84c584a21f5f3827a6fafd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Enable default usage of utf8 sources for Qt consumersAlexandru Croitor2020-05-151-0/+7
| | | | | | | | | | And enable the same default when building Qt itself (it's implicit). Allow opting out on a target-by-target basis, by using the public qt_disable_utf8_sources() API call. Change-Id: Ifc19a744d57b96b1c74a6926a0c6628c2a820464 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use correct file typeYuhang Zhao2020-05-121-1/+6
| | | | | Change-Id: Ie32a32bd1cc3e5885a6699e8ea2281982527e50e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmake: Remove the DISCARDABLE flag for icon resourcesYuhang Zhao2020-05-111-1/+1
| | | | | | | | | | According to [1] the DISCARDABLE attribute is for 16-bit Windows, and it is ignored. We can drop it. [1] https://docs.microsoft.com/en-us/windows/win32/menurc/common-resource-attributes Change-Id: I70e5b0441a9d20f6c76c3d7a84947f8bce5c8fbd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add more entries for rc filesYuhang Zhao2020-05-111-1/+31
| | | | | | | | | As what we did for QMake. Amends commit 317383217baa280b7e7401a5adc4ce976320e272 Change-Id: Iab3b755193b5483362896da20a03fe2d59f37192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmake: Update the macro namesYuhang Zhao2020-05-121-2/+2
| | | | | | | | | | | | | | | | I generated a rc file using VS2019 and I found that it's using other macros. According to [1], both of VOS_NT_WINDOWS32 and VOS__WINDOWS32 refers to "File was designed for 32-bit Windows", although they have different values, and 0x0L is the value of VFT2_UNKNOWN. So I think it's safe to update them. VS2019 is using them as the default template for rc files, after all. [1] https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource Change-Id: Ibaf91394668844492f1357da05b881b9d81aa15f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Workaround fix for failing RC file generation on WindowsAlexandru Croitor2020-05-111-2/+1
| | | | | | | | | | | | | | | For some reason the Help target doesn't get its RC file generated when building qttools, which leads to a build failure. We don't quite know yet why all this is happening, but a workaround fix seems to be to use an OBJECT library instead of an INTERFACE library to propagate the generated RC file. Amends 657fa0462d552110e2ba14bcac46275e6066993f Fixes: QTBUG-84155 Change-Id: I1e1c2f3b05bae2ed009020d031c6510a517c01ec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix Windows RC file generation for multi-config buildsJoerg Bornemann2020-05-071-14/+38
| | | | | | | | | | | | | | | | | | | | | | For Ninja Multi-Config we now generate RC files in a path matching the current config name. We have to work around https://gitlab.kitware.com/cmake/cmake/-/issues/20682 to add the generated config-dependent RC files to the target. But due to https://gitlab.kitware.com/cmake/cmake/-/issues/20683 the OriginalFilename entry in the generated resource will be wrong for all configurations but the main one. Cross fingers that this will be fixed upstream. In the meantime: ignore the issue. Drive-by changes: - Fix the function comment. - Surround the RC file name by double quotes in case there are spaces in the path. Fixes: QTBUG-83986 Change-Id: If2fec41fa8050b3feb92c3ce051fde1a5bad0239 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix icons in generated RC fileJoerg Bornemann2020-05-071-1/+1
| | | | | | Change-Id: Idb11bd2058f2ec3f258845aea0d314430ff7c578 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Do not generate RC files for STATIC and OBJECT librariesJoerg Bornemann2020-05-071-2/+2
| | | | | | | | | Those library types typically do not have Windows resources with version information. Change-Id: I1a385c2ae4e40d5c153ac6501c5ed826eaf75655 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set QT_PLUGIN_CLASS_NAME also on public pluginsMårten Nordheim2020-04-301-0/+10
| | | | | | | ... and update handling of CLASS_NAME in qt_internal_add_plugin Change-Id: Iec8e5f9f80df02c9ba21648535872988839f4b64 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add qt6_add_plugin public APILeander Beernaert2020-04-221-0/+54
| | | | | | | | | | | | | | | This patch adds a publicly callable qt6_add_plugin() API to create plugins. This API is meant to cover cases such as the plugandpaint example. This patch also renames qt_add_plugin to qt_internal_add_plugin in order to avoid clashes with the public API. To avoid breaking the existing projects, a compatibility wrapper function is enabled by default unless QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY is specified. Fixes: QTBUG-82961 Change-Id: If5b564a8406c90434f1bdad0b8df76d3e6626b5f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Move Resources API into Qt6CoreMacrosLeander Beernaert2020-04-201-0/+184
| | | | | | | | Move QT6_ADD_RESOURCE to Qt6CoreMacros in order to avoid the extra config file step. Change-Id: Ib445ca35c648cf344ee8795de8bdddc0f0758972 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove qt6_use_modulesKai Koehne2020-03-251-46/+0
| | | | | | | | | | | qt5_use_modules has been deprecated in 2013 (commit d9ea4bb144153) and removed for the first time in 2018, but then brought back - see discussion in https://lists.qt-project.org/pipermail/development/2018-June/032837.html . Anyhow, I think we can finally put it to a rest in Qt 6. Change-Id: I770f7e93406ad68535d1d90e4a3bacfb920e2d5a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix metatype file generation not to happen in the source dirAlexandru Croitor2020-03-231-0/+7
| | | | | | | | | | | | | | | | | When building qtdeclarative in a non-prefix configuration, metatypes.json files were created in the source dir. This happened because the default arg_INSTALL_DIR value is relative in qt6_generate_meta_types_json_file, and thus a file(TOUCH) with a relative path creats it in the source dir. The fix is to check if it's relative during a non-prefix build, and make it absolute (relative to the install prefix, which is the qtbase build dir). Change-Id: Ie9abbd5d93a64e79184d77655d8d8399e894fde5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Depend on automoc timestamp for metatypes extractionLeander Beernaert2020-03-051-13/+40
| | | | | | | | | When using CMake 3.17 with any of the Ninja generators we can leverage a dependency on the timestamp file produced by CMake's automoc to avoid having a custom target run on every build. Change-Id: Ia70d2730cc8296d0a43642655fe69b555cb393c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: fix typoMårten Nordheim2020-03-051-1/+1
| | | | | | | | gerate -> generate Change-Id: I948a3bdb4f56584a9ab02f27760fec5989d528ce Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate Win32 Resource FilesLeander Beernaert2020-02-251-0/+152
| | | | | | | | | | | | | | Add support to generate win32 resources files through CMake. The functionality is implemented via qt6_generate_win32_rc_file() in Qt6CoreMacros.cmake. Currently qt_add_test(), qt_add_module() and add_qt_gui_executable() call the above function when building on windows. The function itself has been written as part of the public API so it can be called from other locations if required. Change-Id: Id5388b3bf9a2068b36780d8268306326f990778c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-02-131-0/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt Hopefully final merge from wip/cmake, and then all cmake changes should target dev directly. Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
| * Fix metatypes source dependencies for non-prefix buildLeander Beernaert2020-02-121-0/+4
| | | | | | | | | | Change-Id: I0b262929f74c8da10f42d9ddbc7c119dc21619cf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-1/+8
|/ | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
* Refactor Metatypes dependency propagationLeander Beernaert2020-02-101-116/+40
| | | | | | | | | | | | | | | | Every metatypes.json files is now added as an INTERFACE source file to a target. This enables us later to correctly collect all the metatypes.json files from dependent targets. This information is also correctly exported via export()/install(). To avoid the metatypes.json appearing in every target's source list, the file path is wrapped in a generator expression which will only be evaluated when the consuming target has the property QT_CONSUMES_METATYPES set to true. At the moment this is limited to targets which need to interact with qmltyperegistrar. Change-Id: I0ffebcd069a923383f7ed11cde2c94ecf2fb13f3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow manually specification of moc.json files for metatype generationLeander Beernaert2020-02-051-46/+90
| | | | | | | | | | | | | | qt6_generate_meta_types_json_file() has been extended to allow the generated moc_....cpp.json files to be manually specified. This now enabled the metatype generation to be used without resorting to AUTOMOC. Additionally, Core_qobject declaration order has been temporarily moved as it otherwise does not produce the correct metatypes dependency file for Core. This will be fixed in a follow up patch. Change-Id: I3266ab3073db478458a0c1dbc8b9fbab16622a64 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update add_custom_command and add_custom_target dependenciesLeander Beernaert2020-02-031-5/+15
| | | | | | | | | | | If we don't add the executable used by the custom_target and/or custom_command to list of the command's/target's dependencies (DEPENDS) the generated file will not update should the executable change. Change-Id: Idce30f3dd4f756d9e8f6848c5e16f5dd6c7c8f0a Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Only add --automoc-json to AUTOMOC_OPTIONS for metatypes targetsLeander Beernaert2020-01-291-0/+5
| | | | | Change-Id: I7c2e859a83ea78c2a6cf2ad59c175c1b29a74621 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Skip processing '-framework' flags in qt6_generate_meta_types_dep_fileAlexandru Croitor2020-01-291-0/+4
| | | | | | | | | | | | Otherwise we get generation errors due to calling GENEX_EVAL on something that is an invalid target. Perhaps there will be a better way once https://gitlab.kitware.com/cmake/cmake/issues/20287 is fixed. Change-Id: I6af9511cbb9942b9edbc3b3fc7028936308715d8 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Generate metatypes dependency fileLeander Beernaert2020-01-291-4/+155
| | | | | | | | | | | | | | | | Due to generator expression it is impossible to recursively evaluate the link dependencies of a target. This is required by QtDeclarative's qmltyperegistrar. To overcome this we generate a ${target}_metatypes_dep.txt file which contain lines with the following pattern: ${PATH_TO_METATYPES.json}=${PATH_TO_METATYPES_DEP.txt} This can be used to recursively evaluate the dependencies at run time. Change-Id: Ia4cee0632c16ba9631e0289db906fe9d320844a3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix qt_import_plugins compatibility with Qt 5Alexandru Croitor2020-01-271-4/+30
| | | | | | | | | | Handle versionless plugin names passed to qt_import_plugins. Task-number: QTBUG-74137 Task-number: QTBUG-80477 Change-Id: Ic7fb6e54d2822c7eb58a7874b4a1c137f0c101d9 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Add Qt 5 backward compatible CMake APIAlexandru Croitor2020-01-271-31/+71
| | | | | | | | | | | Create versionless function names, that coincide with the Qt 5 CMake API. Task-number: QTBUG-74137 Task-number: QTBUG-80477 Change-Id: I8559b2c8a49b23e5a89ec81603aaec54ea634d70 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-271-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-47/+42
| | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
* Collect Json Metatypes from CMake's AutomocLeander Beernaert2019-12-041-0/+58
| | | | | | | | | | | | | | | | | | | | 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>
* Add custom targets to generate Android APKLeander Beernaert2019-10-231-0/+1
| | | | | | | | | | This patch adds two custom targets to generate android apks. The targets are named ${TARGET}_prepare_apk_dir and ${TARGET}_make_apk. The first one insures the binary is copied to the right location and the latter invokes androiddeployqt on the apk directory. Change-Id: I8152cef387b50ec03ee2bfd92b56910a6f22754c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-111-0/+32
| | | | Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
* Match qt_import_plugin API with qt5'sJean-Michaël Celerier2019-10-091-11/+46
| | | | | | | | | | Some work was needed to make the plug-in types, and which plug-ins are available for each type in client code. Change-Id: Ib71feca31069deca3d3f54c8613054f5f8ae410c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix add_qt_gui_executable for non-Gui projectsJoerg Bornemann2019-09-191-1/+4
| | | | | | | ...which is needed, because pro2cmake thinks everything is a Gui project. Change-Id: Ib68f3eb0e796365e03b3805a3f742824cc263157 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix casing of public API functionsSimon Hausmann2019-09-191-13/+13
| | | | | | | | | Use lower case for the function name as that's cmake style. Change-Id: I6c53166aa3a8cece4abe8a485e06bd359fc12a06 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix OUTPUT_TARGET propagation in qt6_add_resource()Leander Beernaert2019-09-161-0/+4
| | | | | | | | | | | Value was not being propagated to the parent scope when set. This patch also changes OUTPUT_TARGET to OUTPUT_TARGETS since it is possible that two targets can be generated. Change-Id: If489a609ed363a319224fcd6c5a4fc878d0d8617 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Update Android build configurationLeander Beernaert2019-08-301-0/+1
| | | | | | | | | | | | | | | | | | Update Android build configuration to be compatible with the multi-arch android build patch to qmake. We can now build and generate the apk correctly. Executing on the device/simulator will only work once the latest changes from 5.14 have been merged in. We now replace target suffix with ${CMAKE_ANDROID_ARCH_ABI}.[so|a] so we don't have to deal with handling targets which might have any of the OUTPUT_NAME properties set. The dependency and deploy settings generation has also been updated to append the file contents to a string and then do a single file write at the end. Change-Id: Id3c5bd0428141ecaf962124a100390e3a4e41feb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update public CMake macros' versionLeander Beernaert2019-08-231-37/+37
| | | | | | | Update all public Qt macros to use qt6/QT6 instead of qt5/QT6. Change-Id: Ib178f4fa21f37dfb8da7d4d8c097aa0e96c9d9f9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Extract add_qt_resource into reusable componentsLeander Beernaert2019-08-221-27/+32
| | | | | | | | | | | | | | | | | | | | | | | | This patch moves all of the underlying code for add_qt_resource into a common reusable snippet for both the Qt build and user projects. For users, the new API is available under QT5_ADD_RESOURCES. If outfiles is a CMAKE target we will use the new API, otherwise we will fall back to the old behavior. This patch also adds EXTRA_CMAKE_FILES and EXTRA_CMAKE_INCLUDES to add_qt_module so that module specific cmake files can be installed and loaded by the module's config.cmake. The code will be installed under CMAKE_BINARY_DIR/Qt{}CoreResource.cmake and is injected into Qt{}Core_Config.cmake via the extra cmake includes passed into add_qt_module. To make sure it still works with QtBuild, we do the actual generation of the file from QtBaseGlobalTargets and include the generated file there as well. Change-Id: I85fefaa11dde01a6790d23c62d6a64cd157e2617 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-0/+5
| | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
* cmake: allow client apps to load static plug-insJean-Michaël Celerier2019-07-051-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | Based in part on Kyle Edwards's implementation : https://codereview.qt-project.org/c/qt/qtbase/+/243731 Example : ``` cmake_minimum_required(VERSION 3.15) project(foo) add_executable(foo main.cpp) find_package(ICU COMPONENTS i18n uc data REQUIRED) find_package(Qt6 COMPONENTS Core Gui REQUIRED) target_link_libraries(foo Qt6::Core Qt6::Gui) qt_import_plugins(foo INCLUDE Qt6::qxcb EXCLUDE Qt6::qgtk3 Qt6::qeglfs-kms-integration Qt6::qjpeg ) ``` Change-Id: If7736c42f669f7d7f43052cae59c28fc7fcb4156 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Clean up application module visibility on AndroidSimon Hausmann2019-07-021-5/+6
| | | | | | | | | Disable ELF visibility using CMake properties on the shared object that's supposed to contain main(). Change-Id: I9cdbb2a76ad66cf2742280ddfea47908eaff2370 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Final changes for APK generationLeander Beernaert2019-06-261-0/+5
| | | | | | | | | | | | | | | | | | | | Generate the ${MODULE}-android-dependencies.xml for the androiddeployqt tool. This will ensure all the right plugins and dependencies are packaged when generating the apk. This change also changes the visibility for executable to default/public. Not having this will cause the application to crash as we can't locate main() in the executable (shared library). Additionally pro2cmake conversion script has been updated to perform the required conversions for the Android settings. Finally, the 6 projects in QtBase that have Android dependencies have been updated with the new script and the step that produces the xml files in run at the end in QtPostProcess.cmake. Change-Id: I9774ba1b123bc11cae972fa37054ef2c51988498 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>