Add option to build and install the designer plugin

The patch adds a cmake option BUILD_DESIGNER_PLUGIN, targeted
mainly at package maintainers to allow an easy build and installation
of the FreeCAD designer plugin.

It has been discussed in
https://forum.freecadweb.org/viewtopic.php?f=10&t=67706

Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
This commit is contained in:
Bernd Waibel
2022-04-04 19:03:30 +02:00
committed by wwmayer
parent bc017a7c03
commit 0e8b87bf51
6 changed files with 29 additions and 9 deletions

View File

@@ -0,0 +1,9 @@
macro(BuildAndInstallDesignerPlugin)
# =================================================================
# ============= Build and install the designer plugin =============
# =================================================================
if(BUILD_DESIGNER_PLUGIN)
add_subdirectory(src/Tools/plugins/widget)
endif(BUILD_DESIGNER_PLUGIN)
endmacro(BuildAndInstallDesignerPlugin)

View File

@@ -80,6 +80,8 @@ macro(InitializeFreeCADBuildOptions)
endif()
configure_file(${CMAKE_SOURCE_DIR}/src/QtOpenGL.h.cmake ${CMAKE_BINARY_DIR}/src/QtOpenGL.h)
option(BUILD_DESIGNER_PLUGIN "Build and install the designer plugin" OFF)
if(APPLE)
option(FREECAD_CREATE_MAC_APP "Create app bundle on install" OFF)

View File

@@ -92,6 +92,11 @@ macro(PrintFinalReport)
message(STATUS "Qt5WebKitWidgets: not needed (BUILD_WEB)")
message(STATUS "Qt5WebEngineWidgets: not needed (BUILD_WEB)")
endif(BUILD_WEB)
if(BUILD_DESIGNER_PLUGIN)
message(STATUS "Designer plugin: ${DESIGNER_PLUGIN_LOCATION}/libFreeCAD_widgets.so")
else(BUILD_DESIGNER_PLUGIN)
message(STATUS "Designer plugin: not built per user request (BUILD_DESIGNER_PLUGIN)")
endif(BUILD_DESIGNER_PLUGIN)
if(${Qt5WinExtras_FOUND})
message(STATUS "Qt5WinExtras: ${Qt5WinExtras_VERSION}")
endif()

View File

@@ -29,6 +29,9 @@ if(BUILD_GUI)
endif()
endif()
endif()
if(BUILD_DESIGNER_PLUGIN)
find_package(Qt5Designer REQUIRED)
endif()
if(MSVC)
find_package(Qt5WinExtras QUIET)
endif()