-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plugins of imported QtModules to the _qt_plugins property
This covers the following use case: QtModuleX is pre-built and installed, it's imported. The plugin has a PLUGIN_TYPE that is associated with QtModuleX and is built with application that links QtModuleX. When deploying the application it's expected that the plugin is deployed, as the one that belongs to the linked QtModuleX. This ensures that we udpate the internal _qt_plugins property that is used in the __qt_internal_collect_plugin_targets_from_dependencies function. Pick-to: 6.5 6.6 6.7 Change-Id: I9824351ebab5a24509800da4db69f1e282a35884 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
- Loading branch information
Showing
5 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (C) 2024 The Qt Company Ltd. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
cmake_minimum_required(VERSION 3.16) | ||
|
||
project(test_collecting_plugins | ||
VERSION | ||
"${CMAKE_Core_MODULE_MAJOR_VERSION}.${CMAKE_Core_MODULE_MINOR_VERSION}.${CMAKE_Core_MODULE_PATCH_VERSION}") | ||
|
||
find_package(Qt6 COMPONENTS Core Gui BuildInternals REQUIRED) | ||
|
||
qt_prepare_standalone_project() | ||
|
||
qt_internal_add_plugin(QTestImagePlugin | ||
SHARED | ||
PLUGIN_TYPE imageformats | ||
SOURCES | ||
plugin.cpp | ||
LIBRARIES | ||
Qt6::Gui | ||
SKIP_INSTALL # Make sure that we do not package this plugin | ||
) | ||
|
||
qt_add_executable(TestExecutable main.cpp) | ||
target_link_libraries(TestExecutable PRIVATE Qt6::Gui) | ||
|
||
__qt_internal_collect_plugin_targets_from_dependencies(TestExecutable plugin_targets) | ||
|
||
if(NOT "QTestImagePlugin" IN_LIST plugin_targets) | ||
message(FATAL_ERROR "QTestImagePlugin plugin is missing") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright (C) 2024 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | ||
|
||
int main(int, char *[]) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (C) 2024 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | ||
|
||
#include <qimageiohandler.h> | ||
|
||
class TestImagePlugin : public QImageIOPlugin | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface") | ||
public: | ||
Capabilities capabilities(QIODevice *, const QByteArray &) const override { return {}; } | ||
QImageIOHandler *create(QIODevice *, const QByteArray & = QByteArray()) const override | ||
{ | ||
return nullptr; | ||
} | ||
}; | ||
|
||
#include "plugin.moc" |