mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Replace deprecated qt5_use_modules function (#1419)
* Replace deprecated qt5_use_modules function * Fix includes that fall under a larger module * Bump minimum Cmake version to use newer features and properly use libs * Replace deprecated qt5_use_modules function and bump minimum CMake version to 3.1.0 for 3rd party libraries
This commit is contained in:
committed by
Martin Kleusberg
parent
3cdc65a63f
commit
961141ec36
@@ -1,5 +1,5 @@
|
||||
project(sqlitebrowser)
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
# BUILD_VERSION is the current date in YYYYMMDD format. It is only
|
||||
# used by the nightly version to add the date of the build.
|
||||
@@ -22,7 +22,13 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
add_definitions(-std=c++11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
|
||||
if (POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)
|
||||
endif ()
|
||||
|
||||
if(WIN32 AND MSVC)
|
||||
project("DB Browser for SQLite")
|
||||
@@ -78,11 +84,8 @@ endif()
|
||||
add_subdirectory(${QHEXEDIT_DIR})
|
||||
add_subdirectory(${QCUSTOMPLOT_DIR})
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5LinguistTools REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5Concurrent REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Concurrent Gui LinguistTools Network PrintSupport Test Widgets Xml)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
@@ -267,7 +270,6 @@ set(LICENSE_FILES
|
||||
LICENSE-PLUGINS
|
||||
)
|
||||
|
||||
|
||||
qt5_wrap_ui(SQLB_FORM_HDR ${SQLB_FORMS})
|
||||
if(SQLB_TSS)
|
||||
# add translations
|
||||
@@ -355,9 +357,6 @@ add_executable(${PROJECT_NAME}
|
||||
${SQLB_RESOURCES_RCC}
|
||||
${SQLB_MISC})
|
||||
|
||||
qt5_use_modules(${PROJECT_NAME} Gui Widgets Network Test PrintSupport Concurrent Xml)
|
||||
set(QT_LIBRARIES "")
|
||||
|
||||
add_dependencies(${PROJECT_NAME} qhexedit qcustomplot)
|
||||
if(NOT ANTLR2_FOUND)
|
||||
add_dependencies(${PROJECT_NAME} antlr)
|
||||
@@ -377,11 +376,13 @@ if(NOT QSCINTILLA_FOUND)
|
||||
link_directories("${CMAKE_CURRENT_BINARY_DIR}/${QSCINTILLA_DIR}")
|
||||
endif()
|
||||
|
||||
set(QT_LIBS Qt5::Gui Qt5::Test Qt5::PrintSupport Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::Xml)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
qhexedit
|
||||
qcustomplot
|
||||
${LPTHREAD}
|
||||
${QT_LIBRARIES}
|
||||
${LPTHREAD}
|
||||
${QT_LIBS}
|
||||
${WIN32_STATIC_LINK}
|
||||
${LIBSQLITE}
|
||||
${ADDITIONAL_LIBS})
|
||||
@@ -423,7 +424,7 @@ endif()
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES src/icons/${PROJECT_NAME}.png
|
||||
DESTINATION share/icons/hicolor/256x256/apps/)
|
||||
|
||||
|
||||
install(FILES distri/${PROJECT_NAME}.desktop
|
||||
DESTINATION share/applications/)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
set(ANTLR_SRC
|
||||
src/ANTLRUtil.cpp
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
cmake_minimum_required(VERSION 2.8.7)
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
|
||||
find_package(Qt5 REQUIRED COMPONENTS Widgets PrintSupport)
|
||||
|
||||
set(QCUSTOMPLOT_SRC
|
||||
qcustomplot.cpp
|
||||
@@ -17,4 +18,4 @@ set(QCUSTOMPLOT_MOC_HDR
|
||||
|
||||
add_library(qcustomplot ${QCUSTOMPLOT_SRC} ${QCUSTOMPLOT_HDR} ${QCUSTOMPLOT_MOC})
|
||||
|
||||
qt5_use_modules(qcustomplot Widgets PrintSupport)
|
||||
target_link_libraries(qcustomplot Qt5::Widgets Qt5::PrintSupport)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
cmake_minimum_required(VERSION 2.8.7)
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
|
||||
find_package(Qt5 REQUIRED COMPONENTS Widgets)
|
||||
|
||||
set(QHEXEDIT_SRC
|
||||
src/qhexedit.cpp
|
||||
@@ -22,4 +23,4 @@ set(QHEXEDIT_MOC_HDR
|
||||
|
||||
add_library(qhexedit ${QHEXEDIT_SRC} ${QHEXEDIT_HDR} ${QHEXEDIT_MOC})
|
||||
|
||||
qt5_use_modules(qhexedit Widgets)
|
||||
target_link_libraries(qhexedit Qt5::Widgets)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
cmake_minimum_required(VERSION 2.8.7)
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
|
||||
find_package(Qt5 REQUIRED COMPONENTS PrintSupport Widgets)
|
||||
|
||||
if(APPLE)
|
||||
find_package(Qt5MacExtras)
|
||||
find_package(Qt5 REQUIRED COMPONENTS MacExtras)
|
||||
endif()
|
||||
|
||||
add_definitions(-DSCINTILLA_QT)
|
||||
@@ -166,8 +167,8 @@ include_directories(. ../include ../lexlib ../src)
|
||||
|
||||
add_library(qscintilla2 ${QSCINTILLA_SRC} ${QSCINTILLA_HDR} ${QSCINTILLA_MOC_HDR} ${QSCINTILLA_MOC})
|
||||
|
||||
target_link_libraries(qscintilla2 Qt5::Widgets Qt5::PrintSupport)
|
||||
|
||||
if (APPLE)
|
||||
qt5_use_modules(qscintilla2 Widgets PrintSupport MacExtras)
|
||||
else()
|
||||
qt5_use_modules(qscintilla2 Widgets PrintSupport)
|
||||
target_link_libraries(qscintilla2 Qt5::MacExtras)
|
||||
endif()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <QBuffer>
|
||||
#include <QModelIndex>
|
||||
#include <QJsonDocument>
|
||||
#include <QDomDocument>
|
||||
#include <QtXml/QDomDocument>
|
||||
#include <QMessageBox>
|
||||
|
||||
EditDialog::EditDialog(QWidget* parent)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <QApplication>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkReply>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QFile>
|
||||
#include <QSslKey>
|
||||
#include <QtNetwork/QSslKey>
|
||||
#include <QProgressDialog>
|
||||
#include <QInputDialog>
|
||||
#include <QDir>
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <QUrlQuery>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QHttpMultiPart>
|
||||
#include <QtNetwork/QHttpMultiPart>
|
||||
#include <QTimeZone>
|
||||
|
||||
#include "RemoteDatabase.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define REMOTEDATABASE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSslConfiguration>
|
||||
#include <QtNetwork/QSslConfiguration>
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QString;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <QSslCertificate>
|
||||
#include <QtNetwork/QSslCertificate>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include "RemoteDock.h"
|
||||
|
||||
@@ -48,7 +48,9 @@ QT5_WRAP_UI(TESTSQLOBJECTS_FORM_HDR ${TESTSQLOBJECTS_FORMS})
|
||||
|
||||
add_executable(test-sqlobjects ${TESTSQLOBJECTS_MOC} ${TESTSQLOBJECTS_HDR} ${TESTSQLOBJECTS_SRC} ${TESTSQLOBJECTS_FORM_HDR})
|
||||
|
||||
qt5_use_modules(test-sqlobjects Test Widgets Gui)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Test Widgets Gui)
|
||||
target_link_libraries(test-sqlobjects Qt5::Test Qt5::Widgets Qt5::Gui)
|
||||
|
||||
set(QT_LIBRARIES "")
|
||||
|
||||
if(NOT ANTLR2_FOUND)
|
||||
@@ -78,7 +80,9 @@ set(TESTIMPORT_MOC_HDR
|
||||
|
||||
add_executable(test-import ${TESTIMPORT_MOC} ${TESTIMPORT_SRC})
|
||||
|
||||
qt5_use_modules(test-import Test Core)
|
||||
find_package(Qt5 REQUIRED COMPONENTS Core)
|
||||
target_link_libraries(test-import Qt5::Test Qt5::Core)
|
||||
|
||||
set(QT_LIBRARIES "")
|
||||
|
||||
target_link_libraries(test-import ${QT_LIBRARIES})
|
||||
@@ -124,7 +128,8 @@ endif()
|
||||
|
||||
add_executable(test-regex ${TESTREGEX_MOC} ${TESTREGEX_HDR} ${TESTREGEX_SRC})
|
||||
|
||||
qt5_use_modules(test-regex Test Core Gui Widgets)
|
||||
target_link_libraries(test-regex Qt5::Test Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
||||
set(QT_LIBRARIES "")
|
||||
|
||||
if(NOT ANTLR2_FOUND)
|
||||
@@ -153,7 +158,8 @@ set(TESTCACHE_MOC_HDR
|
||||
|
||||
add_executable(test-cache ${TESTCACHE_MOC} ${TESTCACHE_SRC})
|
||||
|
||||
qt5_use_modules(test-cache Test Core)
|
||||
target_link_libraries(test-cache Qt5::Test Qt5::Core)
|
||||
|
||||
set(QT_LIBRARIES "")
|
||||
|
||||
target_link_libraries(test-cache ${QT_LIBRARIES})
|
||||
|
||||
Reference in New Issue
Block a user