Skip to content

Instantly share code, notes, and snippets.

@nowrep
Created November 4, 2014 10:01
Show Gist options
  • Save nowrep/e585bb460489166ef193 to your computer and use it in GitHub Desktop.
Save nowrep/e585bb460489166ef193 to your computer and use it in GitHub Desktop.
QupZilla: Build option to use system QtSingleApplication library
diff --git a/BUILDING b/BUILDING
index 0f4defc..8a6ad81 100644
--- a/BUILDING
+++ b/BUILDING
@@ -197,7 +197,14 @@ Available Defines
DISABLE_DBUS Build without QtDBus module. Native desktop notifications
will be disabled.
+ (disabled by default)
example:
$ export DISABLE_DBUS="true"
+ SYSTEM_QTSINGLEAPP Use system QtSingleApplication library.
+ (disabled by default)
+
+ example:
+ $ export SYSTEM_QTSINGLEAPP="true"
+
diff --git a/src/defines.pri b/src/defines.pri
index b10564c..d1dd36e 100644
--- a/src/defines.pri
+++ b/src/defines.pri
@@ -26,6 +26,7 @@ d_disable_dbus = $$(DISABLE_DBUS)
d_disable_updates_check = $$(DISABLE_UPDATES_CHECK)
d_debug_build = $$(DEBUG_BUILD)
d_prefix = $$(QUPZILLA_PREFIX)
+d_system_qtsingleapp = $$(SYSTEM_QTSINGLEAPP)
equals(d_no_system_datapath, "true") { DEFINES *= NO_SYSTEM_DATAPATH }
equals(d_use_webgl, "true") { DEFINES *= USE_WEBGL }
@@ -38,6 +39,7 @@ equals(d_nonblock_dialogs, "true") { DEFINES *= NONBLOCK_JS_DIALOGS }
equals(d_use_qtwebkit_2_2, "true") { DEFINES *= USE_QTWEBKIT_2_2 }
equals(d_disable_dbus, "true") { DEFINES *= DISABLE_DBUS }
equals(d_disable_updates_check, "true") { DEFINES *= DISABLE_UPDATES_CHECK }
+equals(d_system_qtsingleapp, "true") { DEFINES *= SYSTEM_QTSINGLEAPP }
equals(d_debug_build, "true") { CONFIG += debug }
DEFINES *= QT_NO_URL_CAST_FROM_STRING
@@ -45,7 +47,6 @@ DEFINES *= QT_USE_QSTRINGBUILDER
CONFIG(debug, debug|release): DEFINES *= QUPZILLA_DEBUG_BUILD
-
win32-msvc* {
DEFINES *= W7API
LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib
diff --git a/src/lib/lib.pro b/src/lib/lib.pro
index feefcf6..6711882 100644
--- a/src/lib/lib.pro
+++ b/src/lib/lib.pro
@@ -11,9 +11,14 @@ DEFINES *= QUPZILLA_SHAREDLIBRARY
include(../defines.pri)
include(../../translations/translations.pri)
-include(3rdparty/qtsingleapplication/qtsingleapplication.pri)
include(plugins/qtwebkit/qtwebkit-plugins.pri)
+contains(DEFINES, "SYSTEM_QTSINGLEAPP") {
+ CONFIG *= qtsingleapplication
+} else {
+ include(3rdparty/qtsingleapplication/qtsingleapplication.pri)
+}
+
CONFIG(debug, debug|release): include(../../tests/modeltest/modeltest.pri)
unix:!contains(DEFINES, "DISABLE_DBUS") QT += dbus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment