Tools: [skip ci] Use qmake to determine Qt plugin directory

This commit is contained in:
wmayer
2022-04-04 02:12:13 +02:00
parent 2714e682db
commit 0b44a6c28d

View File

@@ -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)