Copy over cmake packaging updates from 2.3.x.

This commit is contained in:
Richard Kimberly Heck 2018-09-28 22:18:15 -04:00
parent 1fe6352d4f
commit cbc4e2399a

View File

@ -44,25 +44,48 @@ elseif(WIN32)
set(runtime) set(runtime)
if(LYX_XMINGW) if(LYX_XMINGW)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND runtime /usr/${LYX_XMINGW}/lib/libwinpthread-1.dll)
else() else()
set(GCC_LIBGCC ${CMAKE_CXX_COMPILER}) set(GCC_LIBGCC ${CMAKE_CXX_COMPILER})
endif() endif()
get_filename_component(MINGW_RUNTIME_PATH ${GCC_LIBGCC} PATH)
# RKH
# get_filename_component(MINGW_RUNTIME_PATH ${GCC_LIBGCC} PATH)
set(MINGW_RUNTIME_PATH "/usr/i686-w64-mingw32/sys-root/mingw/bin")
macro(add_runtime_dll _DLL) macro(add_runtime_dll _DLL)
file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/${_DLL}) file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/${_DLL})
list(APPEND runtime ${GCC_RUNTIME}) list(APPEND runtime ${GCC_RUNTIME})
endmacro() endmacro()
add_runtime_dll(iconv.dll)
add_runtime_dll(libgcc*.dll) add_runtime_dll(libgcc*.dll)
add_runtime_dll(libstd*.dll) add_runtime_dll(libstd*.dll)
add_runtime_dll(libwin*.dll) add_runtime_dll(libwin*.dll)
add_runtime_dll(libbz2-1.dll)
add_runtime_dll(libfreetype-6.dll)
add_runtime_dll(libglib-2.0-0.dll)
add_runtime_dll(libgraphite2.dll)
add_runtime_dll(libharfbuzz-0.dll)
add_runtime_dll(libicudt6*.dll)
add_runtime_dll(libicuin6*.dll)
add_runtime_dll(libicuuc6*.dll)
add_runtime_dll(libintl-8.dll)
add_runtime_dll(libjpeg-62.dll)
add_runtime_dll(libpcre-1.dll)
add_runtime_dll(libpcre2-16-0.dll)
add_runtime_dll(libpng16-16.dll)
add_runtime_dll(libtiff-5.dll)
add_runtime_dll(libwebp-7.dll)
add_runtime_dll(libwebpdemux-2.dll)
add_runtime_dll(zlib1.dll)
if(NOT runtime) if(NOT runtime)
message(FATAL_ERROR "No mingw runtime found in ${MINGW_RUNTIME_PATH}") message(FATAL_ERROR "No mingw runtime found in ${MINGW_RUNTIME_PATH}")
endif() endif()
if(LYX_USE_QT MATCHES "QT5") if(LYX_USE_QT MATCHES "QT5")
get_target_property(qmakebin Qt5::qmake IMPORTED_LOCATION) get_target_property(qmakebin Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BINARY_DIR ${qmakebin} PATH) # RKH
# get_filename_component(QT_BINARY_DIR ${qmakebin} PATH)
set(QT_BINARY_DIR "/usr/i686-w64-mingw32/sys-root/mingw/bin")
install(FILES install(FILES
${runtime} ${runtime}
${QT_BINARY_DIR}/Qt5Core.dll ${QT_BINARY_DIR}/Qt5Core.dll
@ -74,28 +97,31 @@ elseif(WIN32)
${QT_BINARY_DIR}/Qt5PrintSupport.dll ${QT_BINARY_DIR}/Qt5PrintSupport.dll
${QT_BINARY_DIR}/Qt5Svg.dll ${QT_BINARY_DIR}/Qt5Svg.dll
${QT_BINARY_DIR}/Qt5WinExtras.dll ${QT_BINARY_DIR}/Qt5WinExtras.dll
DESTINATION bin DESTINATION bin)
CONFIGURATIONS Release)
install(FILES install(FILES
${QT_BINARY_DIR}/../plugins/platforms/qminimal.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/platforms/qminimal.dll
${QT_BINARY_DIR}/../plugins/platforms/qwindows.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/platforms/qwindows.dll
DESTINATION bin/platforms DESTINATION bin/platforms)
CONFIGURATIONS Release)
install(FILES install(FILES
${QT_BINARY_DIR}/../plugins/printsupport/windowsprintersupport.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/printsupport/windowsprintersupport.dll
DESTINATION bin/printsupport DESTINATION bin/printsupport)
CONFIGURATIONS Release)
install(FILES install(FILES
${QT_BINARY_DIR}/../plugins/imageformats/qgif.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qgif.dll
${QT_BINARY_DIR}/../plugins/imageformats/qjpeg.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qicns.dll
${QT_BINARY_DIR}/../plugins/imageformats/qsvg.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qico.dll
${QT_BINARY_DIR}/../plugins/imageformats/qico.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qjpeg.dll
DESTINATION bin/imageformats ${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qsvg.dll
CONFIGURATIONS Release) ${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qtga.dll
${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qtiff.dll
${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qwbmp.dll
${QT_BINARY_DIR}/../lib/qt5/plugins/imageformats/qwebp.dll
DESTINATION bin/imageformats)
install(FILES install(FILES
${QT_BINARY_DIR}/../plugins/iconengines/qsvgicon.dll ${QT_BINARY_DIR}/../lib/qt5/plugins/styles/qwindowsvistastyle.dll
DESTINATION bin/iconengines DESTINATION bin/styles)
CONFIGURATIONS Release) install(FILES
${QT_BINARY_DIR}/../lib/qt5/plugins/iconengines/qsvgicon.dll
DESTINATION bin/iconengines)
else() else()
install(FILES install(FILES
${runtime} ${runtime}
@ -108,7 +134,7 @@ elseif(WIN32)
${QT_PLUGINS_DIR}/imageformats/qsvg4.dll ${QT_PLUGINS_DIR}/imageformats/qsvg4.dll
${QT_PLUGINS_DIR}/imageformats/qtga4.dll ${QT_PLUGINS_DIR}/imageformats/qtga4.dll
${QT_PLUGINS_DIR}/imageformats/qtiff4.dll ${QT_PLUGINS_DIR}/imageformats/qtiff4.dll
DESTINATION bin CONFIGURATIONS Release) DESTINATION bin)
endif() endif()
endif() endif()
else() else()