diff --git a/development/cmake/ConfigureChecks.cmake b/development/cmake/ConfigureChecks.cmake index 46ee11fcbc..6dc82a7d87 100644 --- a/development/cmake/ConfigureChecks.cmake +++ b/development/cmake/ConfigureChecks.cmake @@ -198,7 +198,8 @@ if(LYX_USE_QT MATCHES "QT5") endif() if (Qt5WinExtras_FOUND) get_target_property(_winextra_prop Qt5::WinExtras IMPORTED_CONFIGURATIONS) - get_target_property(_winextra_link_libraries Qt5::WinExtras IMPORTED_LOCATION_${_winextra_prop}) + string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE) + get_target_property(_winextra_link_libraries Qt5::WinExtras IMPORTED_LOCATION_${BUILD_TYPE}) set(CMAKE_REQUIRED_LIBRARIES ${_winextra_link_libraries}) set(CMAKE_REQUIRED_INCLUDES ${Qt5WinExtras_INCLUDE_DIRS}) set(CMAKE_REQUIRED_FLAGS ${Qt5WinExtras_EXECUTABLE_COMPILE_FLAGS}) diff --git a/development/cmake/LyxPackaging.cmake b/development/cmake/LyxPackaging.cmake index 7520ae0cc1..48cf0e96dd 100644 --- a/development/cmake/LyxPackaging.cmake +++ b/development/cmake/LyxPackaging.cmake @@ -41,10 +41,21 @@ elseif(WIN32) set(CPACK_GENERATOR ZIP) set(CPACK_BINARY_ZIP 1) if(MINGW) - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GCC_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE) + set(runtime) + if(LYX_XMINGW) + 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() + set(GCC_LIBGCC ${CMAKE_CXX_COMPILER}) + endif() get_filename_component(MINGW_RUNTIME_PATH ${GCC_LIBGCC} PATH) - file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/*.dll) - list(APPEND runtime ${GCC_RUNTIME} /usr/${LYX_XMINGW}/lib/libwinpthread-1.dll) + macro(add_runtime_dll _DLL) + file(GLOB GCC_RUNTIME ${MINGW_RUNTIME_PATH}/${_DLL}) + list(APPEND runtime ${GCC_RUNTIME}) + endmacro() + add_runtime_dll(libgcc*.dll) + add_runtime_dll(libstd*.dll) + add_runtime_dll(libwin*.dll) if(NOT runtime) message(FATAL_ERROR "No mingw runtime found in ${MINGW_RUNTIME_PATH}") endif()