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

Enhance: add qmake project files #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions example/example.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
############################################################################
# Copyright (C) 2020 Stephen Lyons <[email protected] #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################

TEMPLATE = app
TARGET = example

QT += widgets network

LIBS += \
-L$${OUT_PWD}/../lib \
-lGdbCrashHandler

INCLUDEPATH += \
$${PWD}/../lib


# You can make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# Please consult the documentation of the deprecated API in order to know
# how to port your code away from it.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

# Input
HEADERS += \
example.hpp

SOURCES += \
example.cpp

RESOURCES += \
example.qrc

# It is convenient when working in one project file system to be able to see the
# files for the other one:
DISTFILES += \
CMakeLists.txt
39 changes: 39 additions & 0 deletions gdbcrashhandler.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
############################################################################
# Copyright (C) 2020 Stephen Lyons <[email protected] #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################

TEMPLATE = subdirs

# You can make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# Please consult the documentation of the deprecated API in order to know
# how to port your code away from it.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

# Input
SUBDIRS += lib example

example.depends = lib

CONFIG(release, debug|release):DEFINES+=QT_NO_DEBUG_OUTPUT

# It is convenient when working in one project file system to be able to see the
# files for the other one:
DISTFILES += \
CMakeLists.txt
2 changes: 1 addition & 1 deletion lib/GdbCrashHandlerDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <QTimer>
#include <QUrlQuery>
#include <QUuid>
#include <quazipfile.h>
#include <quazip/quazipfile.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work as a general upstream solution, i.e. other distros use quazip5/quazipfile.h. The proper way is for quazip-devel to ship a CMake module and/or pkg-config file which returns the include path. On Fedora, FindQuaZip5.cmake does this, but quazip does not seem to provide a pkg-config file (which is the typical way to include dependencies with qmake). You'll need to explicitly pass the include dir via QMAKE_CFLAGS env-var when building the project, or patch it locally.


GdbCrashHandlerDialog::GdbCrashHandlerDialog(const GdbCrashHandler::Configuration& config, int pid, const QString& savefile, QWidget *parent)
: QDialog(parent)
Expand Down
80 changes: 80 additions & 0 deletions lib/lib.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
############################################################################
# Copyright (C) 2020 Stephen Lyons <[email protected] #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################

TEMPLATE = lib
TARGET = GdbCrashHandler
VERSION = 0.3.0

QT += widgets network

CONFIG += lrelease embed_translations

# On current Debian Linux there is both a quazip {qt4} and a quazip5 {qt5} and
# we need the qt5 one:
LIBS += -lquazip5

INCLUDEPATH += .

# You can make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# Please consult the documentation of the deprecated API in order to know
# how to port your code away from it.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

# Make the header file mark the symbols for export when compiling into the
# library - but for import when it is used by users - technically this is
# largely a Windows OS requirement:
DEFINES += GDBCRASHHANDLER_LIBRARY

# Pending in another PR - these ensures QStrings are either marked for
# translation with a QObject::tr(...) or QApplication:;translate(...) wrapper
# or with a QStringLiteral(...) or QLatin1String(...) wrapper if NOT.
# DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII

FORMS += \
GdbCrashHandlerDialog.ui

HEADERS += \
GdbCrashHandler.hpp \
GdbCrashHandlerDialog.hpp

SOURCES += \
GdbCrashHandler.cpp \
GdbCrashHandlerDialog.cpp

# Other languages are pending a further PR:
TRANSLATIONS += \
locale/GdbCrashHandler_de.ts #\
# locale/GdbCrashHandler_el.ts \
# locale/GdbCrashHandler_es.ts \
# locale/GdbCrashHandler_fr.ts \
# locale/GdbCrashHandler_it.ts \
# locale/GdbCrashHandler_nl.ts \
# locale/GdbCrashHandler_pl.ts \
# locale/GdbCrashHandler_pt.ts \
# locale/GdbCrashHandler_ru.ts \
# locale/GdbCrashHandler_tr.ts \
# locale/GdbCrashHandler_zh_CN.ts \
# locale/GdbCrashHandler_zh_TW.ts

# It is convenient when working in one project file system to be able to see the
# files for the other one:
DISTFILES += \
CMakeLists.txt