GH-2291 Fix build with Qt 5.11+

This commit is contained in:
Sergey Shatunov 2018-06-01 21:20:33 +07:00
parent f0ff2db4e1
commit 4d68c1b509
No known key found for this signature in database
GPG Key ID: C9228B4C880E14B6
19 changed files with 21 additions and 14 deletions

View File

@ -21,8 +21,7 @@ set_target_properties(MultiMC_gui PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBI
generate_export_header(MultiMC_gui) generate_export_header(MultiMC_gui)
# Link # Link
target_link_libraries(MultiMC_gui MultiMC_iconfix MultiMC_logic) target_link_libraries(MultiMC_gui MultiMC_iconfix MultiMC_logic Qt5::Gui)
qt5_use_modules(MultiMC_gui Gui)
# Mark and export headers # Mark and export headers
target_include_directories(MultiMC_gui PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(MultiMC_gui PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")

View File

@ -476,7 +476,7 @@ generate_export_header(MultiMC_logic)
# Link # Link
target_link_libraries(MultiMC_logic xz-embedded MultiMC_unpack200 systeminfo MultiMC_quazip MultiMC_classparser ${NBT_NAME} ${ZLIB_LIBRARIES}) target_link_libraries(MultiMC_logic xz-embedded MultiMC_unpack200 systeminfo MultiMC_quazip MultiMC_classparser ${NBT_NAME} ${ZLIB_LIBRARIES})
qt5_use_modules(MultiMC_logic Core Xml Network Concurrent) target_link_libraries(MultiMC_logic Qt5::Core Qt5::Xml Qt5::Network Qt5::Concurrent)
# Mark and export headers # Mark and export headers
target_include_directories(MultiMC_logic PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" PRIVATE "${ZLIB_INCLUDE_DIRS}") target_include_directories(MultiMC_logic PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" PRIVATE "${ZLIB_INCLUDE_DIRS}")

View File

@ -2,6 +2,7 @@
#include "ui_NotificationDialog.h" #include "ui_NotificationDialog.h"
#include <QTimerEvent> #include <QTimerEvent>
#include <QStyle>
NotificationDialog::NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent) : NotificationDialog::NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent) :
QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::CustomizeWindowHint), QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::CustomizeWindowHint),

View File

@ -19,6 +19,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QFileDialog> #include <QFileDialog>
#include <QStandardPaths> #include <QStandardPaths>
#include <QTabBar>
#include "settings/SettingsObject.h" #include "settings/SettingsObject.h"
#include "tools/BaseProfiler.h" #include "tools/BaseProfiler.h"

View File

@ -20,6 +20,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QDir> #include <QDir>
#include <QTabBar>
#include "dialogs/VersionSelectDialog.h" #include "dialogs/VersionSelectDialog.h"

View File

@ -18,6 +18,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QDir> #include <QDir>
#include <QTabBar>
#include "settings/SettingsObject.h" #include "settings/SettingsObject.h"
#include "MultiMC.h" #include "MultiMC.h"

View File

@ -19,6 +19,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QFileDialog> #include <QFileDialog>
#include <QStandardPaths> #include <QStandardPaths>
#include <QTabBar>
#include "settings/SettingsObject.h" #include "settings/SettingsObject.h"
#include "tools/BaseProfiler.h" #include "tools/BaseProfiler.h"

View File

@ -16,6 +16,8 @@
#include "ProxyPage.h" #include "ProxyPage.h"
#include "ui_ProxyPage.h" #include "ui_ProxyPage.h"
#include <QTabBar>
#include "settings/SettingsObject.h" #include "settings/SettingsObject.h"
#include "MultiMC.h" #include "MultiMC.h"

View File

@ -1,5 +1,6 @@
#include "NotesPage.h" #include "NotesPage.h"
#include "ui_NotesPage.h" #include "ui_NotesPage.h"
#include <QTabBar>
NotesPage::NotesPage(BaseInstance *inst, QWidget *parent) NotesPage::NotesPage(BaseInstance *inst, QWidget *parent)
: QWidget(parent), ui(new Ui::NotesPage), m_inst(inst) : QWidget(parent), ui(new Ui::NotesPage), m_inst(inst)

View File

@ -7,6 +7,7 @@
#include "dialogs/ProgressDialog.h" #include "dialogs/ProgressDialog.h"
#include "dialogs/NewInstanceDialog.h" #include "dialogs/NewInstanceDialog.h"
#include <QFileDialog> #include <QFileDialog>
#include <QValidator>
#include <InstanceImportTask.h> #include <InstanceImportTask.h>
class UrlValidator : public QValidator class UrlValidator : public QValidator

View File

@ -12,6 +12,7 @@
#include <Filter.h> #include <Filter.h>
#include <Env.h> #include <Env.h>
#include <InstanceCreationTask.h> #include <InstanceCreationTask.h>
#include <QTabBar>
VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent) VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent)
: QWidget(parent), dialog(dialog), ui(new Ui::VanillaPage) : QWidget(parent), dialog(dialog), ui(new Ui::VanillaPage)

View File

@ -7,7 +7,7 @@ message(${TEST_RESOURCE_PATH})
function(add_unit_test name) function(add_unit_test name)
set(options "") set(options "")
set(oneValueArgs DATA) set(oneValueArgs DATA)
set(multiValueArgs SOURCES LIBS QT) set(multiValueArgs SOURCES LIBS)
cmake_parse_arguments(OPT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) cmake_parse_arguments(OPT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@ -40,8 +40,7 @@ function(add_unit_test name)
endif() endif()
endif() endif()
target_link_libraries(${name}_test ${OPT_LIBS}) target_link_libraries(${name}_test Qt5::Test ${OPT_LIBS})
qt5_use_modules(${name}_test Test ${OPT_QT})
target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/") target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")

View File

@ -26,4 +26,4 @@ endif()
add_library(LocalPeer STATIC ${SINGLE_SOURCES}) add_library(LocalPeer STATIC ${SINGLE_SOURCES})
target_include_directories(LocalPeer PUBLIC include) target_include_directories(LocalPeer PUBLIC include)
qt5_use_modules(LocalPeer Core Network) target_link_libraries(LocalPeer Qt5::Core Qt5::Network)

View File

@ -38,5 +38,4 @@ add_definitions(-DCLASSPARSER_LIBRARY)
add_library(MultiMC_classparser STATIC ${CLASSPARSER_SOURCES} ${CLASSPARSER_HEADERS}) add_library(MultiMC_classparser STATIC ${CLASSPARSER_SOURCES} ${CLASSPARSER_HEADERS})
target_include_directories(MultiMC_classparser PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(MultiMC_classparser PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(MultiMC_classparser MultiMC_quazip) target_link_libraries(MultiMC_classparser MultiMC_quazip Qt5::Core)
qt5_use_modules(MultiMC_classparser Core)

View File

@ -12,6 +12,6 @@ include/ganalytics.h
) )
add_library(ganalytics STATIC ${ganalytics_SOURCES}) add_library(ganalytics STATIC ${ganalytics_SOURCES})
qt5_use_modules(ganalytics Core Gui Network) target_link_libraries(ganalytics Qt5::Core Qt5::Gui Qt5::Network)
target_include_directories(ganalytics PUBLIC include) target_include_directories(ganalytics PUBLIC include)
target_link_libraries(ganalytics systeminfo) target_link_libraries(ganalytics systeminfo)

View File

@ -15,7 +15,7 @@ internal/qiconloader_p.h
add_library(MultiMC_iconfix SHARED ${ICONFIX_SOURCES}) add_library(MultiMC_iconfix SHARED ${ICONFIX_SOURCES})
target_include_directories(MultiMC_iconfix PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}" ) target_include_directories(MultiMC_iconfix PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}" )
qt5_use_modules(MultiMC_iconfix Core Widgets) target_link_libraries(MultiMC_iconfix Qt5::Core Qt5::Widgets)
set_target_properties(MultiMC_iconfix PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1) set_target_properties(MultiMC_iconfix PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1)
generate_export_header(MultiMC_iconfix) generate_export_header(MultiMC_iconfix)

@ -1 +1 @@
Subproject commit 683e2ec8ada758d6e48d31ec606840802e6941b7 Subproject commit 469b97b618314ec009a37cad22e9d2541d6481f7

View File

@ -12,7 +12,7 @@ add_definitions(-DRAINBOW_LIBRARY)
add_library(MultiMC_rainbow SHARED ${RAINBOW_SOURCES}) add_library(MultiMC_rainbow SHARED ${RAINBOW_SOURCES})
target_include_directories(MultiMC_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(MultiMC_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
qt5_use_modules(MultiMC_rainbow Core Gui) target_link_libraries(MultiMC_rainbow Qt5::Core Qt5::Gui)
# Install it # Install it
install( install(

View File

@ -19,7 +19,7 @@ elseif (UNIX)
endif() endif()
add_library(systeminfo STATIC ${systeminfo_SOURCES}) add_library(systeminfo STATIC ${systeminfo_SOURCES})
qt5_use_modules(systeminfo Core Gui Network) target_link_libraries(systeminfo Qt5::Core Qt5::Gui Qt5::Network)
target_include_directories(systeminfo PUBLIC include) target_include_directories(systeminfo PUBLIC include)
include (UnitTest) include (UnitTest)