]> sigrok.org Git - pulseview.git/blobdiff - CMakeLists.txt
CMakeLists.txt: Only add Qt5PlatformSupport for Qt < 5.8.0.
[pulseview.git] / CMakeLists.txt
index d210f92ae3cd351b8b87e5254319b00025165b62..a2f12102501b0de26687732f448a655e2a036de7 100644 (file)
@@ -428,12 +428,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 +451,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()