Add option to copy required plugins from LibPack to build directory

This commit is contained in:
wmayer
2019-11-29 13:38:06 +01:00
parent f7be6933fd
commit 281a2772f3
2 changed files with 14 additions and 0 deletions

View File

@@ -59,6 +59,8 @@ macro(InitializeFreeCADBuildOptions)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/bin/DLLs)
set(COPY_LIBPACK_BIN_TO_BUILD ON )
option(FREECAD_COPY_LIBPACK_BIN_TO_BUILD "Copy larger libpack dependency 'bin' folder to the build directory." OFF)
# Copy only the minimum number of files to get a working application
option(FREECAD_COPY_PLUGINS_BIN_TO_BUILD "Copy plugins to the build directory." OFF)
endif()
else()
message("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.")

View File

@@ -234,6 +234,18 @@ macro(PrintFinalReport)
file(COPY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_BINARY_DIR})
message("... done copying libpack 'bin' directory.\n=======================================\n")
endif()
if(FREECAD_COPY_PLUGINS_BIN_TO_BUILD)
message(STATUS "=======================================\n"
"Copying plugins to build directory.")
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf "[Paths]\nPrefix=..\n")
endif()
endif()
if(FREECAD_INSTALL_DEPEND_DIRS)