summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--Documentation/Makefile10
-rw-r--r--subsurface-configure.pri95
-rw-r--r--subsurface-gen-version.pri16
-rw-r--r--subsurface.pro129
5 files changed, 251 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 520248b58..5c1eae4b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,9 @@ ui_*
/subsurface.includes
*.kdev4
callgrind.out.*
+
+.rcc
+.moc
+.uic
+.obj
+subsurface.pro.user*
diff --git a/Documentation/Makefile b/Documentation/Makefile
index c56b3efcb..67d2a0c73 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -7,20 +7,20 @@ BROWSER = firefox
all: doc $(addprefix $(DOCNAME).,pdf text)
-doc: $(HTMLDOC)
+doc: $(OUT)$(HTMLDOC)
-$(DOCNAME).text: $(DOCSOURCE)
+$(OUT)$(DOCNAME).text: $(DOCSOURCE)
$(A2X) -f text $<
-$(DOCNAME).pdf: $(DOCSOURCE)
+$(OUT)$(DOCNAME).pdf: $(DOCSOURCE)
$(A2X) -f pdf $<
-$(HTMLDOC): $(DOCSOURCE)
+$(OUT)$(HTMLDOC): $(DOCSOURCE)
@echo "if asciidoc isn't found no HTML documentation is produced but Subsurface is still functional"
$(ASCIIDOC) $< || true
# Alternatively::
-$(DOCNAME).xhtml: $(DOCSOURCE)
+$(OUT)$(DOCNAME).xhtml: $(DOCSOURCE)
$(A2X) --icons -f xhtml $<
show: $(HTMLDOC)
diff --git a/subsurface-configure.pri b/subsurface-configure.pri
new file mode 100644
index 000000000..93f14003c
--- /dev/null
+++ b/subsurface-configure.pri
@@ -0,0 +1,95 @@
+#
+# Global settings
+#
+# Set some C constructs to be diagnosed as errors:
+# - calling implicit functions
+# - casting from integers to pointers or vice-versa without an explicit cast
+# Also turn on C99 mode with GNU extensions
+*-g++*: QMAKE_CFLAGS += -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=implicit-int
+!win32-msvc*: QMAKE_CFLAGS += -std=gnu99
+
+# Check if we have pkg-config
+equals($$QMAKE_HOST.os, "Windows"):NUL=NUL
+else:NUL=/dev/null
+system(pkg-config --version 2>$$NUL >$$NUL) {
+ CONFIG += link_pkgconfig
+} else {
+ message("pkg-config not found, no detection performed. See README for details")
+}
+
+#
+# Find libdivecomputer
+#
+!isEmpty(LIBDCDEVEL) {
+ # find it next to our sources
+ INCLUDEPATH += ../libdivecomputer/include
+ LIBS += -L../libdivecomputer/src/.libs -ldivecomputer
+} else:exists(/usr/local/lib/libdivecomputer.a) {
+ LIBS += -L/usr/local/lib -ldivecomputer
+} else:exists(/usr/local/lib64/libdivecomputer.a) {
+ LIBS += -L/usr/local/lib64 -ldivecomputer
+} else:link_pkgconfig {
+ # find it via pkg-config
+ PKGCONFIG += libdivecomputer
+}
+
+# Libusb-1.0 is only required if libdivecomputer was built with it.
+# And libdivecomputer is only built with it if libusb-1.0 is
+# installed. So get libusb if it exists, but don't complain
+# about it if it doesn't.
+#link_pkgconfig: packagesExist(libusb-1.0): PKGCONFIG += libusb-1.0
+
+#
+# Find libxml2 and libxslt
+#
+# They come with shell scripts that contain the information we need, so we just
+# run them. They also come with pkg-config files, but those are missing on
+# Mac (where they are part of the XCode-supplied tools).
+#
+XML2_CFLAGS = $$system(xml2-config --cflags 2>$$NUL)
+XSLT_CFLAGS = $$system(xslt-config --cflags 2>$$NUL)
+XML2_LIBS = $$system(xml2-config --libs 2>$$NUL)
+XSLT_LIBS = $$system(xslt-config --libs 2>$$NUL)
+link_pkgconfig {
+ isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS): \
+ error("Could not find libxml2. Did you forget to install it?")
+ isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS): \
+ error("Could not find libxslt. Did you forget to install it?")
+}
+
+QMAKE_CFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
+QMAKE_CXXFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
+LIBS *= $$XML2_LIBS $$XSLT_LIBS
+
+#
+# Find other pkg-config-based projects
+# We're searching for:
+# libzip
+# sqlite3
+link_pkgconfig: PKGCONFIG += libzip sqlite3
+
+#
+# Find libmarble
+#
+# Before Marble 4.9, the GeoDataTreeModel.h header wasn't installed
+# Check if it's present by trying to compile
+# ### FIXME: implement that
+win32: CONFIG(debug, debug|release): LIBS += -lmarblewidgetd
+else: LIBS += -lmarblewidget
+
+#
+# Platform-specific changes
+#
+win32 {
+ LIBS += -lwsock32
+ DEFINES -= UNICODE
+}
+
+#
+# misc
+#
+!equals(V, 1): CONFIG += silent
+MOC_DIR = .moc
+UI_DIR = .uic
+RCC_DIR = .rcc
+OBJECTS_DIR = .obj
diff --git a/subsurface-gen-version.pri b/subsurface-gen-version.pri
new file mode 100644
index 000000000..a94a65adb
--- /dev/null
+++ b/subsurface-gen-version.pri
@@ -0,0 +1,16 @@
+# Generate the version.h file
+VERSION_FILE = version.h
+exists(.git/HEAD): {
+ GIT_HEAD = .git/HEAD
+ VERSION_SCRIPT = $$PWD/scripts/get-version
+ version_h.depends = $$VERSION_SCRIPT
+ version_h.commands = echo \\$${LITERAL_HASH}define VERSION_STRING \\\"`$$VERSION_SCRIPT linux`\\\" > ${QMAKE_FILE_OUT}
+ version_h.input = GIT_HEAD
+ version_h.output = $$VERSION_FILE
+ version_h.variable_out = GENERATED_FILES
+ version_h.CONFIG = ignore_no_exist
+ QMAKE_EXTRA_COMPILERS += version_h
+} else {
+ # This is probably a package
+ system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$VERSION\\\" > $$VERSION_FILE)
+}
diff --git a/subsurface.pro b/subsurface.pro
new file mode 100644
index 000000000..8a4996385
--- /dev/null
+++ b/subsurface.pro
@@ -0,0 +1,129 @@
+include(subsurface-configure.pri)
+
+QT = core gui network webkit svg
+INCLUDEPATH += qt-ui $$PWD
+
+VERSION = 3.1
+
+HEADERS = \
+ color.h \
+ deco.h \
+ device.h \
+ display.h \
+ dive.h \
+ divelist.h \
+ file.h \
+ flag.h \
+ gettextfromc.h \
+ gettext.h \
+ helpers.h \
+ libdivecomputer.h \
+ planner.h \
+ pref.h \
+ profile.h \
+ qt-gui.h \
+ qthelper.h \
+ qt-ui/about.h \
+ qt-ui/completionmodels.h \
+ qt-ui/divecomputermanagementdialog.h \
+ qt-ui/divelistview.h \
+ qt-ui/diveplanner.h \
+ qt-ui/downloadfromdivecomputer.h \
+ qt-ui/globe.h \
+ qt-ui/graphicsview-common.h \
+ qt-ui/kmessagewidget.h \
+ qt-ui/maintab.h \
+ qt-ui/mainwindow.h \
+ qt-ui/modeldelegates.h \
+ qt-ui/models.h \
+ qt-ui/plotareascene.h \
+ qt-ui/preferences.h \
+ qt-ui/printdialog.h \
+ qt-ui/printlayout.h \
+ qt-ui/printoptions.h \
+ qt-ui/profilegraphics.h \
+ qt-ui/simplewidgets.h \
+ qt-ui/starwidget.h \
+ qt-ui/subsurfacewebservices.h \
+ qt-ui/tableview.h \
+ satellite.h \
+ sha1.h \
+ statistics.h \
+ subsurface-icon.h \
+ subsurfacestartup.h \
+ uemis.h \
+ webservice.h
+
+SOURCES = \
+ deco.c \
+ device.c \
+ dive.c \
+ divelist.c \
+ equipment.c \
+ file.c \
+ gettextfromc.cpp \
+ libdivecomputer.c \
+ main.cpp \
+ parse-xml.c \
+ planner.c \
+ profile.c \
+ qt-gui.cpp \
+ qthelper.cpp \
+ qt-ui/about.cpp \
+ qt-ui/completionmodels.cpp \
+ qt-ui/divecomputermanagementdialog.cpp \
+ qt-ui/divelistview.cpp \
+ qt-ui/diveplanner.cpp \
+ qt-ui/downloadfromdivecomputer.cpp \
+ qt-ui/globe.cpp \
+ qt-ui/graphicsview-common.cpp \
+ qt-ui/kmessagewidget.cpp \
+ qt-ui/maintab.cpp \
+ qt-ui/mainwindow.cpp \
+ qt-ui/modeldelegates.cpp \
+ qt-ui/models.cpp \
+ qt-ui/plotareascene.cpp \
+ qt-ui/preferences.cpp \
+ qt-ui/printdialog.cpp \
+ qt-ui/printlayout.cpp \
+ qt-ui/printoptions.cpp \
+ qt-ui/profilegraphics.cpp \
+ qt-ui/simplewidgets.cpp \
+ qt-ui/starwidget.cpp \
+ qt-ui/subsurfacewebservices.cpp \
+ qt-ui/tableview.cpp \
+ save-xml.c \
+ sha1.c \
+ statistics.c \
+ subsurfacestartup.c \
+ time.c \
+ uemis.c \
+ uemis-downloader.c
+
+linux*: SOURCES += linux.c
+mac: SOURCES += macos.c
+win32: SOURCES += windows.c
+
+FORMS = \
+ qt-ui/about.ui \
+ qt-ui/divecomputermanagementdialog.ui \
+ qt-ui/diveplanner.ui \
+ qt-ui/downloadfromdivecomputer.ui \
+ qt-ui/maintab.ui \
+ qt-ui/mainwindow.ui \
+ qt-ui/preferences.ui \
+ qt-ui/printoptions.ui \
+ qt-ui/renumber.ui \
+ qt-ui/subsurfacewebservices.ui \
+ qt-ui/tableview.ui
+
+RESOURCES = subsurface.qrc
+
+TRANSLATIONS = subsurface_de.ts
+
+doc.commands = $(CHK_DIR_EXISTS) Documentation || $(MKDIR) Documentation
+doc.commands += $$escape_expand(\\n\\t)$(MAKE) -C $$PWD/Documentation OUT=$$OUT_PWD/Documentation doc
+all.depends += doc
+QMAKE_EXTRA_TARGETS += doc all
+
+include(subsurface-gen-version.pri)