]> sigrok.org Git - pulseview.git/blobdiff - CMakeLists.txt
CMakeLists.txt: Fix a build issue on MSYS2.
[pulseview.git] / CMakeLists.txt
index b51753b6f790e6e1ca7849c344c0e2b14b34a10c..09f28a19c9ccf1f95e0513d8b38919d6bc32ea85 100644 (file)
@@ -58,10 +58,10 @@ endif()
 list(APPEND PKGDEPS glib-2.0>=2.28.0)
 list(APPEND PKGDEPS glibmm-2.4>=2.28.0)
 
-list(APPEND PKGDEPS libsigrokcxx>=0.5.0)
+list(APPEND PKGDEPS libsigrokcxx>=0.6.0)
 
 if(ENABLE_DECODE)
-       list(APPEND PKGDEPS libsigrokdecode>=0.5.0)
+       list(APPEND PKGDEPS libsigrokdecode>=0.6.0)
 endif()
 
 if(ANDROID)
@@ -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)
@@ -234,7 +237,6 @@ set(pulseview_SOURCES
        pv/views/trace/rowitem.cpp
        pv/views/trace/ruler.cpp
        pv/views/trace/signal.cpp
-       pv/views/trace/signalscalehandle.cpp
        pv/views/trace/timeitem.cpp
        pv/views/trace/timemarker.cpp
        pv/views/trace/trace.cpp
@@ -297,7 +299,6 @@ set(pulseview_HEADERS
        pv/views/trace/rowitem.hpp
        pv/views/trace/ruler.hpp
        pv/views/trace/signal.hpp
-       pv/views/trace/signalscalehandle.hpp
        pv/views/trace/timeitem.hpp
        pv/views/trace/timemarker.hpp
        pv/views/trace/trace.hpp
@@ -335,7 +336,6 @@ if(ENABLE_DECODE)
        list(APPEND pulseview_SOURCES
                pv/binding/decoder.cpp
                pv/data/decodesignal.cpp
-               pv/data/decoderstack.cpp
                pv/data/decode/annotation.cpp
                pv/data/decode/decoder.cpp
                pv/data/decode/row.cpp
@@ -347,7 +347,6 @@ if(ENABLE_DECODE)
 
        list(APPEND pulseview_HEADERS
                pv/data/decodesignal.hpp
-               pv/data/decoderstack.hpp
                pv/views/trace/decodetrace.hpp
                pv/widgets/decodergroupbox.hpp
                pv/widgets/decodermenu.hpp
@@ -432,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)
@@ -452,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()