From: Uwe Hermann Date: Sat, 8 Nov 2014 14:35:49 +0000 (+0100) Subject: CMakeLists.txt: Fix MinGW-w64 build issue related to QtSvg. X-Git-Tag: pulseview-0.3.0~523 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=52f38de6303ee2c5955ca662ab859945ff260876 CMakeLists.txt: Fix MinGW-w64 build issue related to QtSvg. Specify the QtSvg requirement in the 'find_package(Qt4...)' line. Also, change the linking order in the MinGW-w64 case, apparently the build now fails without this. [...]/qt/plugins/imageformats/libqsvg.a(qsvgiohandler.o):\ qsvgiohandler.cpp:(.text+0x571): undefined reference to `QSvgRenderer::load(QByteArray const&)' [...] --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4af1f67b..da3cc09c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,8 +88,7 @@ if(Qt5Core_FOUND) add_definitions(${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) else() find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac) - find_package(Qt4 REQUIRED) - set(QT_USE_QTSVG TRUE) + find_package(Qt4 REQUIRED QtCore QtGui QtSvg) endif() find_package(Boost 1.42 COMPONENTS filesystem system REQUIRED) @@ -340,8 +339,8 @@ if(WIN32) # plugin (and the QtSvg component) for SVG graphics/icons to work. add_definitions(-DQT_STATICPLUGIN) link_directories("${QT_PLUGINS_DIR}/imageformats") - list(APPEND PULSEVIEW_LINK_LIBS ${QT_QTSVG_LIBRARY}) list(APPEND PULSEVIEW_LINK_LIBS "-lqsvg") + list(APPEND PULSEVIEW_LINK_LIBS ${QT_QTSVG_LIBRARY}) endif() if(ANDROID)