diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -8,7 +8,7 @@ include(BrewHelper) find_brew_prefix(QT5_PREFIX qt5) -set(QT_REQUIRED_COMPONENTS Core Widgets Network Test) +set(QT_REQUIRED_COMPONENTS Core Widgets Network Test Gui) find_package(Qt5 COMPONENTS ${QT_REQUIRED_COMPONENTS} REQUIRED HINTS "${QT5_PREFIX}") # Find out more about Qt. This is similar to @@ -150,6 +150,23 @@ # Windows support if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") target_sources(bitcoin-qt-base PRIVATE winshutdownmonitor.cpp) + + # Use windows platform plugin + target_compile_definitions(bitcoin-qt-base INTERFACE + -DQT_STATICPLUGIN=1 + -DQT_QPA_PLATFORM_WINDOWS=1 + ) + + find_library(_Qt5EventDispatcherSupport Qt5EventDispatcherSupport) + find_library(_Qt5FontDatabaseSupport Qt5FontDatabaseSupport) + find_library(_Qt5ThemeSupport Qt5ThemeSupport) + + target_link_libraries(bitcoin-qt-base + Qt5::QWindowsIntegrationPlugin + ${_Qt5EventDispatcherSupport} + ${_Qt5FontDatabaseSupport} + ${_Qt5ThemeSupport} + ) endif() target_include_directories(bitcoin-qt-base @@ -165,6 +182,7 @@ rpcclient Qt5::Widgets Qt5::Network + Qt5::Gui OpenSSL::SSL ${Protobuf_LIBRARIES} )