From 81fdb4dee5083a59dbdb2d01fcb6ab13285be26b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 31 Jan 2023 15:05:45 +0100 Subject: Qt Designer: Fix install of plugin examples Pick-to: 6.5 6.4 Task-number: QTBUG-110447 Change-Id: I1b243a6a564ea18d684a8d5fa8d3310facf81f7d Reviewed-by: Alexandru Croitor --- examples/designer/containerextension/CMakeLists.txt | 15 +++++++++------ examples/designer/customwidgetplugin/CMakeLists.txt | 15 +++++++++------ examples/designer/taskmenuextension/CMakeLists.txt | 15 +++++++++------ examples/designer/worldtimeclockplugin/CMakeLists.txt | 15 +++++++++------ 4 files changed, 36 insertions(+), 24 deletions(-) (limited to 'examples') diff --git a/examples/designer/containerextension/CMakeLists.txt b/examples/designer/containerextension/CMakeLists.txt index 545d83ccf..be1767b87 100644 --- a/examples/designer/containerextension/CMakeLists.txt +++ b/examples/designer/containerextension/CMakeLists.txt @@ -6,12 +6,6 @@ project(containerextension LANGUAGES CXX) set(CMAKE_AUTOMOC ON) -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") - find_package(Qt6 REQUIRED COMPONENTS Core Designer Gui Widgets) qt_add_plugin(containerextension) @@ -34,6 +28,15 @@ target_link_libraries(containerextension PUBLIC Qt::Widgets ) +if(QT6_INSTALL_PREFIX) + set(INSTALL_EXAMPLEDIR "${QT6_INSTALL_PREFIX}/${QT6_INSTALL_PLUGINS}/designer") +else() + if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") + endif() + set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") +endif() + install(TARGETS containerextension RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/designer/customwidgetplugin/CMakeLists.txt b/examples/designer/customwidgetplugin/CMakeLists.txt index 4f3adaa14..3878a9a78 100644 --- a/examples/designer/customwidgetplugin/CMakeLists.txt +++ b/examples/designer/customwidgetplugin/CMakeLists.txt @@ -6,12 +6,6 @@ project(customwidgetplugin LANGUAGES CXX) set(CMAKE_AUTOMOC ON) -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") - find_package(Qt6 REQUIRED COMPONENTS Core Gui UiPlugin Widgets) qt_add_plugin(customwidgetplugin) @@ -32,6 +26,15 @@ target_link_libraries(customwidgetplugin PUBLIC Qt::Widgets ) +if(QT6_INSTALL_PREFIX) + set(INSTALL_EXAMPLEDIR "${QT6_INSTALL_PREFIX}/${QT6_INSTALL_PLUGINS}/designer") +else() + if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") + endif() + set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") +endif() + install(TARGETS customwidgetplugin RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/designer/taskmenuextension/CMakeLists.txt b/examples/designer/taskmenuextension/CMakeLists.txt index 98996eada..a0dcaf373 100644 --- a/examples/designer/taskmenuextension/CMakeLists.txt +++ b/examples/designer/taskmenuextension/CMakeLists.txt @@ -6,12 +6,6 @@ project(taskmenuextension LANGUAGES CXX) set(CMAKE_AUTOMOC ON) -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") - find_package(Qt6 REQUIRED COMPONENTS Core Designer Gui Widgets) qt_add_plugin(taskmenuextension) @@ -34,6 +28,15 @@ target_link_libraries(taskmenuextension PUBLIC Qt::Widgets ) +if(QT6_INSTALL_PREFIX) + set(INSTALL_EXAMPLEDIR "${QT6_INSTALL_PREFIX}/${QT6_INSTALL_PLUGINS}/designer") +else() + if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") + endif() + set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") +endif() + install(TARGETS taskmenuextension RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/designer/worldtimeclockplugin/CMakeLists.txt b/examples/designer/worldtimeclockplugin/CMakeLists.txt index bdd85fc1b..30d9bc0a0 100644 --- a/examples/designer/worldtimeclockplugin/CMakeLists.txt +++ b/examples/designer/worldtimeclockplugin/CMakeLists.txt @@ -6,12 +6,6 @@ project(worldtimeclockplugin LANGUAGES CXX) set(CMAKE_AUTOMOC ON) -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") - find_package(Qt6 REQUIRED COMPONENTS Core Gui UiPlugin Widgets) qt_add_plugin(worldtimeclockplugin) @@ -32,6 +26,15 @@ target_link_libraries(worldtimeclockplugin PUBLIC Qt::Widgets ) +if(QT6_INSTALL_PREFIX) + set(INSTALL_EXAMPLEDIR "${QT6_INSTALL_PREFIX}/${QT6_INSTALL_PLUGINS}/designer") +else() + if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") + endif() + set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/plugins/designer") +endif() + install(TARGETS worldtimeclockplugin RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" -- cgit v1.2.1