From 0b44a6c28d387fbe8f578f8067a99240f97ea9ba Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 4 Apr 2022 02:12:13 +0200 Subject: [PATCH] Tools: [skip ci] Use qmake to determine Qt plugin directory --- src/Tools/plugins/widget/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Tools/plugins/widget/CMakeLists.txt b/src/Tools/plugins/widget/CMakeLists.txt index 193e04a52b..2cbe14523b 100644 --- a/src/Tools/plugins/widget/CMakeLists.txt +++ b/src/Tools/plugins/widget/CMakeLists.txt @@ -23,11 +23,14 @@ add_library(FreeCAD_widgets SHARED target_link_libraries(FreeCAD_widgets PRIVATE ${Qt5Widgets_LIBRARIES} ${Qt5Designer_LIBRARIES}) target_compile_options(FreeCAD_widgets PRIVATE ${COMPILE_OPTIONS}) + # Get the install location of a plugin to determine the path to designer plguins -get_target_property(WEBENGINE_PLUGIN_LOCATION Qt5::QWebEngineViewPlugin LOCATION) -get_filename_component(DESIGNER_PLUGIN_LOCATION ${WEBENGINE_PLUGIN_LOCATION} DIRECTORY) +get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION) +exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_PLUGINS" RETURN_VALUE return_code OUTPUT_VARIABLE DEFAULT_QT_PLUGINS_DIR ) +set(DESIGNER_PLUGIN_LOCATION ${DEFAULT_QT_PLUGINS_DIR}/designer) message(STATUS "Plugin will installed to: ${DESIGNER_PLUGIN_LOCATION}") + # Override the CMake variable set(CMAKE_INSTALL_PREFIX ${DESIGNER_PLUGIN_LOCATION} CACHE PATH "Install path to Qt Designer plugins" FORCE)