Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated qt5_use_modules function #1419

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 15 additions & 14 deletions CMakeLists.txt
@@ -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.
Expand All @@ -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")
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -263,7 +266,6 @@ set(LICENSE_FILES
LICENSE-PLUGINS
)


qt5_wrap_ui(SQLB_FORM_HDR ${SQLB_FORMS})
if(SQLB_TSS)
# add translations
Expand Down Expand Up @@ -351,9 +353,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)
Expand All @@ -373,11 +372,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})
Expand Down Expand Up @@ -419,7 +420,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/)

Expand Down
2 changes: 1 addition & 1 deletion libs/antlr-2.7.7/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.1.0)

set(ANTLR_SRC
src/ANTLRUtil.cpp
Expand Down
7 changes: 4 additions & 3 deletions libs/qcustomplot-source/CMakeLists.txt
@@ -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
Expand All @@ -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)
7 changes: 4 additions & 3 deletions libs/qhexedit/CMakeLists.txt
@@ -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
Expand All @@ -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)
13 changes: 7 additions & 6 deletions libs/qscintilla/Qt4Qt5/CMakeLists.txt
@@ -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)
Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion src/EditDialog.cpp
Expand Up @@ -14,7 +14,7 @@
#include <QBuffer>
#include <QModelIndex>
#include <QJsonDocument>
#include <QDomDocument>
#include <QtXml/QDomDocument>
#include <QMessageBox>

EditDialog::EditDialog(QWidget* parent)
Expand Down
8 changes: 4 additions & 4 deletions src/RemoteDatabase.cpp
@@ -1,17 +1,17 @@
#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>
#include <QStandardPaths>
#include <QUrlQuery>
#include <QJsonDocument>
#include <QJsonObject>
#include <QHttpMultiPart>
#include <QtNetwork/QHttpMultiPart>
#include <QTimeZone>

#include "RemoteDatabase.h"
Expand Down
2 changes: 1 addition & 1 deletion src/RemoteDatabase.h
Expand Up @@ -2,7 +2,7 @@
#define REMOTEDATABASE_H

#include <QObject>
#include <QSslConfiguration>
#include <QtNetwork/QSslConfiguration>

class QNetworkAccessManager;
class QString;
Expand Down
2 changes: 1 addition & 1 deletion src/RemoteDock.cpp
@@ -1,4 +1,4 @@
#include <QSslCertificate>
#include <QtNetwork/QSslCertificate>
#include <QFileInfo>

#include "RemoteDock.h"
Expand Down
14 changes: 10 additions & 4 deletions src/tests/CMakeLists.txt
Expand Up @@ -44,7 +44,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)
Expand Down Expand Up @@ -74,7 +76,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})
Expand Down Expand Up @@ -116,7 +120,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)
Expand Down Expand Up @@ -145,7 +150,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})
Expand Down