summaryrefslogtreecommitdiffstats
path: root/cmake/QtPluginDependencies.cmake.in
Commit message (Collapse)AuthorAgeFilesLines
* Change license for .in filesLucie Gérard2024-03-051-0/+3
| | | | | | | | | | | | | According to QUIP-18 [1], all build system files should be BSD-3-Clause. The files in this patch are part of the build system. [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Ibc6a60a9b009fab0c953e8e3269533c121e4511e Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* CMake: Suggest hints on how to debug missing packagesAlexandru Croitor2022-07-181-1/+2
| | | | | | | | | | | | | | | | | | | | | Depending on CMake version suggest usage of either --debug-find-pkg or CMAKE_FIND_DEBUG_MODE to help troubleshoot why dependent packages are not found. To achieve that, append the hint message to the _NOT_FOUND_MESSAGE. To ensure it works for qt dependencies, and not only tool and 3rd party dependencies, _qt_internal_find_qt_dependencies is modified to set variable names infixed by the target name, so the name is consistent with the other dependency lookup functions. The check and message are also added when a Qt6 component is not found. Pick-to: 6.4 Task-number: QTBUG-104998 Change-Id: I4ef23d1c53ac8e04eb72c260d6860c1eeec8d7a3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Rename _qt_internal_find_dependencies to something less genericAlexandru Croitor2022-07-181-1/+1
| | | | | | | Pick-to: 6.4 Task-number: QTBUG-104998 Change-Id: I99b69865f711ff57511f32df2f345cebb7445d44 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Extract package dependency finding into functionsAlexandru Croitor2022-07-181-29/+1
| | | | | | | | | | | | | | | | Aside from moving the code to reduce duplication, the only changes in the code are the replacement of @target@ to ${target}, using IN LISTS with variable names to avoid macro expansion issues and replacing the if(var) conditions with double variable evaluation + NOT STREQUAL "". The function implementations are now in the same order as they are used in the Dependencies.cmake files. Pick-to: 6.4 Task-number: QTBUG-104998 Change-Id: Iaae926414fd2a7cc09c2f5716376caaa0aade74b Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Use namespaced variables in Qt6*Dependencies.cmakeLi Xinwei2021-07-241-23/+23
| | | | | | | Pick-to: 6.2 6.1 Change-Id: I166988020cfd9750a4d58e519742215d0c03ad3e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move dependency lookup functionality to the common macroAlexey Edelev2021-06-191-25/+3
| | | | | | | | | | Dependency lookup mechanism is the same for modules and plugins. It makes sense to wrap it using macro. Pick-to: 6.2 Change-Id: I73727743b0f5f40b2d94624f65ebfcf85e8dcc59 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle OPTIONAL_COMPONENTS in qt_find_packageAlexandru Croitor2021-06-171-0/+5
| | | | | | | | | | | | | | | | | | The optional components arguments were not handled before which caused the recorded package information for static builds to be incorrect, it only recorded the package name without the component. Remove REQUIRED_COMPONENTS TODO, there is no such find_package option, it's already handled by the regular COMPONENTS code path. Amends 07b6d3367debd8f15974abf0f5cdf48f0fe3a536 Pick-to: 6.1 6.2 Fixes: QTBUG-94501 Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge main and private targets of the internal modulesAlexey Edelev2021-05-201-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In cmake, targets are used as an entity for modules. This causes a number of problems when we want to manipulate a module as a separate entity with properties associated with it. The _qt_internal_module_interface_name target property is introduced to represent the module entity. All modules write a name to this property, which will subsequently expand into the module name matched with the module name in qmake. The 'qt_internal_module_info' function is responsible for providing the correct values ​​for the module properties used when working with a module target. Unlike qmake, for internal modules in cmake it is expected that the Private suffix will be specified explicitly. In case the user wants to have a different module name, an additional argument MODULE_INTERFACE_NAME of the qt_internal_add_module function is introduced. This also changes the way how target dependencies are collected and resolved. Since the 'Private' suffix no longer means an unique identifier of the module 'Private' part, we look for the both Private and non-Private package names when resolving dependencies. TODO: This change doesn't affect the existing internal modules, so to keep compatibility with the existing code the existing internal modules create 'Private' aliases. The code that provides backward compatibility must be removed once all internal modules will get the proper names. Taks-number: QTBUG-87775 Change-Id: Ib4f28341506fb2e73eee960a709e24c42bbcd5ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve support for QT_ADDITIONAL_PACKAGES_PREFIX_PATHKai Köhne2021-03-031-1/+2
| | | | | | | | | | | | | | | | | | | Allow to set QT_ADDITIONAL_PACKAGES_PREFIX_PATH as both an env variable and CMake cache variable. Also normalize path and list separators, so that they can be used similar to CMAKE_PREFIX_PATH. The environment variable is intended to be set by the conan virtualenv generator, so that e.g. find_package(Qt6 COMPONENTS NetworkAuth REQUIRED) also works if NetworkAuth is not installed into the Qt prefix. Pick-to: 6.1 Fixes: QTBUG-91142 Change-Id: Ia9f9b9fa2b1b051d33073629139640d0f4c7a843 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io>
* CMake: Allow finding Qt CMake packages in additional locationsAlexandru Croitor2020-09-281-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, when using the Qt6 CMake package to look for components, the find_package() calls for the components use NO_DEFAULT_PATH to ensure that CMake doesn't accidentally find system (distro) packages. Instead we limit the paths to one level up from where the Qt6 package is. Unfortunately that doesn't quite work for finding Qt packages that might have been installed into a different prefix than where the main Qt prefix is. This happens when Qt addons are built by Conan, and installed into a separate prefix. To allow calls like find_package(Qt6 COMPONENTS ConanAddon) to work in a scenario as described above, introduce a new variable called QT_ADDITIONAL_PACKAGES_PREFIX_PATH which can be used to specify additional paths where Qt CMake packages should be found. This is similar to previously introduced QT_EXAMPLES_CMAKE_PREFIX_PATH variable which was meant for a similar case, but only for examples. Additionally, allow disabling the NO_DEFAULT_PATH option by setting the QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES cache variable to TRUE. This would allow regular usage of CMAKE_PREFIX_PATH to work, at the risk that system Qt CMake packages might be found. Augments 5cd4001bf2a7f0894c6ac269860e833b02df6cde and ffe088941378e32ea30c142cca7e63c537a41ff1. Fixes: QTBUG-86882 Change-Id: Ia8e060cbba6d2a10c3d63d81892f2c71e4236a9a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Revert "Revert "CMake: Add facility to mark package dependencies as optional""Joerg Bornemann2020-09-141-4/+12
| | | | | | | | | This reverts commit b0c51f86f40b6b6d18fe2bb75cc851d36395240d. The build failure caused by 58c1c6ee5c986d502b56eb1cc57f1d9444d42031 has been fixed. Change-Id: Ic7458d54c7a874588e8b1bfeca61df1842763656 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "Revert "CMake: Reduce the number of find_dependency calls""Joerg Bornemann2020-09-141-4/+3
| | | | | | | | | This reverts commit 6e1a570dc8560489d10120cbd019a665f33f49c2. The build failure caused by 58c1c6ee5c986d502b56eb1cc57f1d9444d42031 has been fixed. Change-Id: I67acaa2d1dd5fc88c205b054252be2e6e26898c7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "Revert "CMake: Fix usage of find_dependency()""Joerg Bornemann2020-09-141-15/+9
| | | | | | | | ...and fix the build errors the original change caused. This reverts commit 127fb8bb5587db52216d0ac934f3111170a7cbe3. Change-Id: I4006b32734a51c5d101dd73c957f81d2a0f84ba1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "CMake: Fix usage of find_dependency()"Lars Knoll2020-09-131-9/+15
| | | | | | | | | | This reverts commit 58c1c6ee5c986d502b56eb1cc57f1d9444d42031. This lead to configuration errors on some machines, blocking development. Change-Id: I744f6cc95fbaa273519ab8fc8fb492b87f5729b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "CMake: Reduce the number of find_dependency calls"Lars Knoll2020-09-131-3/+4
| | | | | | | | | | This reverts commit a3cb002511d7e2cc73234611795c1947620aedd5. This lead to configuration errors on some machines, blocking development. Change-Id: Ibb785c96c7d85692a6e22a73e086119eb571df71 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "CMake: Add facility to mark package dependencies as optional"Lars Knoll2020-09-131-12/+4
| | | | | | | | | | This reverts commit 3685483c4b79b4075bab6d341174a395359d1b4a. This lead to configuration errors on some machines, blocking development. Change-Id: I309cdd55a8ef64899afcbeca54458d1c6d686951 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Add facility to mark package dependencies as optionalJoerg Bornemann2020-09-121-4/+12
| | | | | | | | | | | | | | | | Every public dependency of a Qt module results in a find_package call in the consuming project. But not all public dependencies are mandatory. For example, vulkan is only needed if the user project actually uses Qt classes that pull in vulkan headers. This patch adds the option MARK_OPTIONAL to qt_find_package. Dependencies that are marked as optional will not produce an error on find failure. Task-number: QTBUG-86421 Change-Id: Ia767e7f36991e236582c7509cbd37ea3487bb695 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Reduce the number of find_dependency callsJoerg Bornemann2020-09-121-4/+3
| | | | | | | | | | ...in code. The actual number of calls at runtime does not change. The reason for this stunt is that we want to replace find_dependency with find_package at runtime for optional dependencies, and this will reduce the diff size of the next commit. Change-Id: I304fdf09c69fea7b6d4adabf515712eb097f8c86 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix usage of find_dependency()Joerg Bornemann2020-09-121-15/+9
| | | | | | | | | | | | The find_dependency() macro calls return() on failure, meaning any code after it will be ignored, thus checking any XXX_FOUND variables after find_dependency() is pointless. Fix the places where we use find_dependency() and set the "failed" state before the call and the "success" state afterwards. Change-Id: Ia5239c704f02a9bec972210374ffed7808b14055 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prepare ground work for static Qml plugins importingAlexandru Croitor2020-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | For qt_import_qml_plugins to work, it needs to have access to the Qml plugin targets by the time find_package(Qt6Qml) is called. To do that, we modify the generation of Qml plugin Config, Targets and Dependencies files to go into a special 'QmlPlugins' subfolder of the Qml package. The Qml package will then GLOB include all the Config files in that folder, to make them available whenever find_package(Qt6Qml) is called. This is similar to how the Qt plugins were glob included in the CMake integration of Qt 5.15. In fact that glob including is missing in Qt 6 for regular Qt plugins, and should be implemented in a following change. Currently the Qt Plugins config files that are included are hardcoded to the list of known plugins at Qt configuration time. As a drive-by to make this all work, the naming of the various Config and Dependencies files has been normalized to include the Qt6 prefix. This is done for both regular Qt plugins and Qml plugins. Task-number: QTBUG-85961 Change-Id: Id20da72337ca2945fa330ea6fb43535e44a83292 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Always try to find dependencies for pluginsAlexandru Croitor2019-10-141-2/+0
| | | | | | | | | | | | | | | | Generated plugin CMake files should always try to call find_dependency, especially in static builds. pkg_check_modules sets a cache value for foo_FOUND instead of a directory scope foo_FOUND, which means that find_dependency will not be called in another scope, and thus fail to create needed imported targets. Note this makes the code be the same as in ModuleDependencies.cmake.in. Change-Id: I0b58b038afcb72cb27d0b433371bc9cb5e4bfec9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Always append extra cmake modules to CMAKE_MODULE_PATH in Qt6ConfigAlexandru Croitor2019-10-011-10/+0
| | | | | | | | | | | | | | | | | | | | | | During a static build we need to use the find modules in 3rdparty/extra-cmake-modules/find-modules when generating a ModuleDependencies file, so that the generated find_dependency() calls succeed. This means that the files have to be shipped with Qt6 package, making them pseudo public API. There is also a need to use these files when building QtWayland. Instead of setting / unsetting CMAKE_MODULE_PATH only in module and plugin Dependencies cmake files, just set them once when finding Qt6. This will allow QtWayland and QtX11Extras to easily find the required third party packages, without having to hardcode the paths in multiple repos. Change-Id: I750d0421a269e5632afa1bb62498c2501d73cdb1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix examples find_package calls to work in prefix buildsAlexandru Croitor2019-09-211-1/+1
| | | | | | | | | | | | | | | | | | | To build examples as part of a non-installed Qt prefix build, not-yet-installed Config files need to be found by find_package() calls inside example projects. Facilitate that by propagating the CMAKE_PREFIX_PATH and QT_EXAMPLES_CMAKE_PREFIX_PATH paths in all relevant find_package() calls where NO_DEFAULT_PATH is used. Also adjust the inclusion of the QtFeature.cmake file to be relative to the qt6 directory, rather than the current list directory. This is needed to successfully find the file when parsing a Config file from a non-installed build directory. Change-Id: I36031279628f1f7741d8f4d7571484a6545227f7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix building against an installed static QtSimon Hausmann2019-06-251-5/+6
| | | | | | | | | | | | | | | | For ICU we have multiple components, and ICU becomes a public dependency to QtCore. When storing the INTERFACE_QT_PACKAGE_COMPONENTS property, make sure to store the entire list of components, not just the first component -- by turning the semi-colon separated list into a space separated list. When processing the components at find_dependency time, we need to reverse that and pass COMPONENTS directly to ensure a correct parameter expansion. Change-Id: I24a0708520e7d5fba039395a151034aee4d4c0e2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-141-1/+1
| | | | | | | | | | This changes many different CMake places to mention Qt6 instead of Qt5. Note that some old qt5 cmake config files in corelib are probably not needed anymore, but I still renamed and kept them for now. Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
* cmake: register plug-ins, create dependencies fileJean-Michaël Celerier2019-06-041-0/+53
This commit introduces infrastructure work to allow static builds of Qt to handle importing of plug-ins. Change-Id: Ife0ca3ca7276ea8ec96fe0eb6adf934fad7620ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>