X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=CMakeLists.txt;h=09f28a19c9ccf1f95e0513d8b38919d6bc32ea85;hp=d210f92ae3cd351b8b87e5254319b00025165b62;hb=929b9b19c6a4ca673696c7cabca823acf542d182;hpb=2d458a761b9fb184cd1c903485293f86fd552637 diff --git a/CMakeLists.txt b/CMakeLists.txt index d210f92a..09f28a19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,10 @@ find_package(Qt5 COMPONENTS Core Gui Widgets Svg REQUIRED) 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) + # Not required (and doesn't work) on MSYS2. + if(NOT DEFINED ENV{MSYSTEM}) + pkg_check_modules(QT5ALL REQUIRED Qt5Widgets Qt5Gui Qt5Svg) + endif() endif() set(QT_LIBRARIES Qt5::Gui Qt5::Widgets Qt5::Svg) @@ -428,12 +431,15 @@ 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. + # We also need QWindowsIntegrationPlugin, Qt5PlatformSupport (only for + # Qt < 5.8.0), and all Qt libs and their dependencies. add_definitions(-DQT_STATICPLUGIN) list(APPEND PULSEVIEW_LINK_LIBS Qt5::QSvgPlugin) list(APPEND PULSEVIEW_LINK_LIBS Qt5::QWindowsIntegrationPlugin) - list(APPEND PULSEVIEW_LINK_LIBS -lQt5PlatformSupport ${QT5ALL_LDFLAGS}) + if(Qt5Gui_VERSION VERSION_LESS 5.8.0) + list(APPEND PULSEVIEW_LINK_LIBS -lQt5PlatformSupport) + endif() + list(APPEND PULSEVIEW_LINK_LIBS ${QT5ALL_LDFLAGS}) endif() if(ANDROID) @@ -448,7 +454,7 @@ endif() target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS}) -if(WIN32) +if(WIN32 AND NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug") # Pass -mwindows so that no "DOS box" opens when PulseView is started. set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows") endif()