X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=CMakeLists.txt;h=9d35376bbfcd2d9dff1773e306d51bfd0d105ce1;hp=ee58ce2cd6b335f00e272dc172ee79f50ab2b2d5;hb=09f55d9665efb3b17ba7de4bae47be6989e884fe;hpb=e0ba4f6fb263b4cc1dae96df2a0ff1e1ef8984ce diff --git a/CMakeLists.txt b/CMakeLists.txt index ee58ce2c..9d35376b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,11 @@ if(FORCE_QT4) set(Qt5Core_FOUND FALSE) else() find_package(Qt5Core QUIET) +if(WIN32) + # MXE workaround: Use pkg-config to find Qt5 libs. + # https://github.com/mxe/mxe/issues/1642 + pkg_check_modules(QT5ALL REQUIRED Qt5Widgets Qt5Gui Qt5Svg) +endif() endif() if(Qt5Core_FOUND) @@ -446,11 +451,7 @@ set(PULSEVIEW_LINK_LIBS if(STATIC_PKGDEPS_LIBS) link_directories(${PKGDEPS_STATIC_LIBRARY_DIRS}) - list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_STATIC_LIBRARIES}) -if(WIN32) - # Workaround for a MinGW linking issue. - list(APPEND PULSEVIEW_LINK_LIBS "-llzma -llcms2") -endif() + list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_STATIC_LDFLAGS}) else() link_directories(${PKGDEPS_LIBRARY_DIRS}) list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) @@ -459,10 +460,12 @@ endif() if(WIN32) # On Windows we need to statically link the libqsvg imageformat # plugin (and the QtSvg component) for SVG graphics/icons to work. + # We also need QWindowsIntegrationPlugin, Qt5PlatformSupport, and all + # Qt libs and their dependencies. add_definitions(-DQT_STATICPLUGIN) - link_directories("${QT_PLUGINS_DIR}/imageformats") - list(APPEND PULSEVIEW_LINK_LIBS "-lqsvg") - list(APPEND PULSEVIEW_LINK_LIBS ${QT_QTSVG_LIBRARY}) + list(APPEND PULSEVIEW_LINK_LIBS Qt5::QSvgPlugin) + list(APPEND PULSEVIEW_LINK_LIBS Qt5::QWindowsIntegrationPlugin) + list(APPEND PULSEVIEW_LINK_LIBS -lQt5PlatformSupport ${QT5ALL_LDFLAGS}) endif() if(ANDROID)