2013-10-07 00:52:34 +00:00
|
|
|
#
|
|
|
|
# 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
|
2013-10-09 15:11:50 +00:00
|
|
|
*-g++*: QMAKE_CFLAGS += -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=implicit-int
|
|
|
|
|
|
|
|
# these warnings are in general just wrong and annoying - but should be
|
|
|
|
# turned on every once in a while in case they do show the occasional
|
|
|
|
# actual bug
|
2013-12-20 04:42:59 +00:00
|
|
|
# turns out the gcc 4.2 (as used on MacOS 10.6) doesn't have no-unused-result, yet
|
|
|
|
*-clang*: QMAKE_CFLAGS += -Wno-unused-result -Wno-pointer-sign -fno-strict-overflow
|
|
|
|
*-g++*: {
|
|
|
|
system( g++ --version | grep -e "4\\.2\\." > /dev/null ) {
|
|
|
|
QMAKE_CFLAGS += -Wno-pointer-sign -fno-strict-overflow
|
|
|
|
} else {
|
|
|
|
QMAKE_CFLAGS += -Wno-unused-result -Wno-pointer-sign -fno-strict-overflow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-09 17:28:08 +00:00
|
|
|
*-clang*: QMAKE_CFLAGS += -Wno-format-security
|
2013-11-21 13:03:56 +00:00
|
|
|
*-g++*: QMAKE_CXXFLAGS += -fno-strict-overflow
|
2013-11-28 10:13:37 +00:00
|
|
|
!win32: !mac: {
|
2013-11-21 13:03:56 +00:00
|
|
|
*-g++*: QMAKE_CXXFLAGS += -Wno-maybe-uninitialized
|
|
|
|
*-g++*: QMAKE_CFLAGS += -Wno-maybe-uninitialized
|
|
|
|
}
|
2014-01-03 06:35:44 +00:00
|
|
|
mac: QMAKE_CLAGS += -mmacosx-version-min=10.5
|
|
|
|
mac: QMAKE_CXXLAGS += -mmacosx-version-min=10.5
|
2013-10-09 15:11:50 +00:00
|
|
|
|
|
|
|
|
2013-10-07 00:52:34 +00:00
|
|
|
!win32-msvc*: QMAKE_CFLAGS += -std=gnu99
|
|
|
|
|
2013-10-09 06:44:45 +00:00
|
|
|
# Don't turn warnings on (but don't suppress them either)
|
|
|
|
CONFIG -= warn_on warn_off
|
|
|
|
|
2013-10-09 06:45:38 +00:00
|
|
|
# Turn exceptions off
|
|
|
|
!win32-msvc*: QMAKE_CXXFLAGS += -fno-exceptions
|
|
|
|
CONFIG += exceptions_off
|
|
|
|
|
2013-10-07 00:52:34 +00:00
|
|
|
# Check if we have pkg-config
|
2013-10-11 20:25:37 +00:00
|
|
|
isEmpty(PKG_CONFIG):PKG_CONFIG=pkg-config
|
2013-10-07 00:52:34 +00:00
|
|
|
equals($$QMAKE_HOST.os, "Windows"):NUL=NUL
|
|
|
|
else:NUL=/dev/null
|
2013-10-11 20:25:37 +00:00
|
|
|
PKG_CONFIG_OUT = $$system($$PKG_CONFIG --version 2> $$NUL)
|
2013-10-09 22:18:48 +00:00
|
|
|
!isEmpty(PKG_CONFIG_OUT) {
|
2013-12-03 21:00:22 +00:00
|
|
|
CONFIG += link_pkgconfig
|
2013-10-07 00:52:34 +00:00
|
|
|
} else {
|
2013-12-03 21:00:22 +00:00
|
|
|
message("pkg-config not found, no detection performed. See README for details")
|
2013-10-07 00:52:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Find libdivecomputer
|
|
|
|
#
|
|
|
|
!isEmpty(LIBDCDEVEL) {
|
2013-12-03 21:00:22 +00:00
|
|
|
# find it next to our sources
|
2014-02-02 02:52:06 +00:00
|
|
|
INCLUDEPATH += ../libdivecomputer/include $$OUT_PWD/../libdivecomputer/include
|
2013-12-03 21:00:22 +00:00
|
|
|
LIBS += ../libdivecomputer/src/.libs/libdivecomputer.a
|
|
|
|
LIBDC_LA = ../libdivecomputer/src/libdivecomputer.la
|
2013-10-11 20:25:37 +00:00
|
|
|
} else:!isEmpty(CROSS_PATH):exists($${CROSS_PATH}"/lib/libdivecomputer.a"):exists($${CROSS_PATH}"/lib/libusb-1.0.a") {
|
2013-12-03 21:00:22 +00:00
|
|
|
LIBS += $${CROSS_PATH}"/lib/libdivecomputer.a" $${CROSS_PATH}"/lib/libusb-1.0.a"
|
2013-10-07 00:52:34 +00:00
|
|
|
} else:exists(/usr/local/lib/libdivecomputer.a) {
|
2013-12-03 21:00:22 +00:00
|
|
|
LIBS += /usr/local/lib/libdivecomputer.a
|
|
|
|
LIBDC_LA = /usr/local/lib/libdivecomputer.la
|
2013-10-07 00:52:34 +00:00
|
|
|
} else:exists(/usr/local/lib64/libdivecomputer.a) {
|
2013-12-03 21:00:22 +00:00
|
|
|
LIBS += /usr/local/lib64/libdivecomputer.a
|
|
|
|
LIBDC_LA = /usr/local/lib64/libdivecomputer.la
|
2013-10-07 00:52:34 +00:00
|
|
|
} else:link_pkgconfig {
|
2013-12-03 21:00:22 +00:00
|
|
|
# find it via pkg-config, but we need to pass the --static flag,
|
|
|
|
# so we can't use the PKGCONFIG variable.
|
|
|
|
LIBS += $$system($$PKG_CONFIG --static --libs libdivecomputer)
|
|
|
|
LIBDC_CFLAGS = $$system($$PKG_CONFIG --static --cflags libdivecomputer)
|
|
|
|
QMAKE_CFLAGS += $$LIBDC_CFLAGS
|
|
|
|
QMAKE_CXXFLAGS += $$LIBDC_CFLAGS
|
|
|
|
unset(LIBDC_CFLAGS)
|
2013-10-07 00:52:34 +00:00
|
|
|
}
|
|
|
|
|
2013-10-10 00:40:25 +00:00
|
|
|
!isEmpty(LIBDC_LA):exists($$LIBDC_LA) {
|
2013-12-03 21:00:22 +00:00
|
|
|
# Source the libtool .la file to get the dependent libs
|
|
|
|
LIBS += $$system(". $$LIBDC_LA && echo \$dependency_libs")
|
|
|
|
unset(LIBDC_LA)
|
2013-10-10 00:40:25 +00:00
|
|
|
}
|
2013-10-07 00:52:34 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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).
|
|
|
|
#
|
|
|
|
link_pkgconfig {
|
2013-12-03 21:00:22 +00:00
|
|
|
isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS) {
|
|
|
|
XML2_CFLAGS = $$system($$PKG_CONFIG --cflags libxml2 2> $$NUL)
|
|
|
|
XML2_LIBS = $$system($$PKG_CONFIG --libs libxml2 2> $$NUL)
|
|
|
|
}
|
2014-01-15 08:27:38 +00:00
|
|
|
isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS) {
|
|
|
|
XML2_CFLAGS = $$system($$PKG_CONFIG --cflags libxml-2.0 2> $$NUL)
|
|
|
|
XML2_LIBS = $$system($$PKG_CONFIG --libs libxml-2.0 2> $$NUL)
|
|
|
|
}
|
2013-12-03 21:00:22 +00:00
|
|
|
isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS) {
|
|
|
|
XSLT_CFLAGS = $$system($$PKG_CONFIG --cflags libxslt 2> $$NUL)
|
|
|
|
XSLT_LIBS = $$system($$PKG_CONFIG --libs libxslt 2> $$NUL)
|
|
|
|
}
|
2013-10-07 00:52:34 +00:00
|
|
|
}
|
2014-02-02 03:26:53 +00:00
|
|
|
isEmpty(XML2_CFLAGS)|isEmpty(XML2_LIBS) {
|
|
|
|
XML2_CFLAGS = $$system(xml2-config --cflags 2>$$NUL)
|
|
|
|
XML2_LIBS = $$system(xml2-config --libs 2>$$NUL)
|
|
|
|
}
|
|
|
|
isEmpty(XSLT_CFLAGS)|isEmpty(XSLT_LIBS) {
|
|
|
|
XSLT_CFLAGS = $$system(xslt-config --cflags 2>$$NUL)
|
|
|
|
XSLT_LIBS = $$system(xslt-config --libs 2>$$NUL)
|
|
|
|
}
|
|
|
|
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?")
|
|
|
|
|
2013-10-07 00:52:34 +00:00
|
|
|
|
|
|
|
QMAKE_CFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
|
|
|
|
QMAKE_CXXFLAGS *= $$XML2_CFLAGS $$XSLT_CFLAGS
|
2014-01-15 08:27:37 +00:00
|
|
|
LIBS *= $$XSLT_LIBS $$XML2_LIBS
|
2013-10-07 00:52:34 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Find other pkg-config-based projects
|
|
|
|
# We're searching for:
|
|
|
|
# libzip
|
|
|
|
# sqlite3
|
Initial implementation of git save format
This saves the dive data into a git object repository instead of a
single XML file.
We create a git object tree with each dive as a separate file,
hierarchically by trip and date.
NOTE 1: This largely duplicates the XML saving code, because trying to
share it seemed just too painful: the logic is very similar, but the
details of the actual strings end up differing sufficiently that there
are tons of trivial differences.
The git save format is line-based with minimal quoting, while XML quotes
everything with either "<..\>" or using single quotes around attributes.
NOTE 2: You currently need a dummy "file" to save to, which points to
the real save location: the git repository and branch to be used. We
should make this a config thing, but for testing, do something like
this:
echo git /home/torvalds/scuba:linus > git-test
to create that git information file, and when you use "Save To" and
specify "git-test" as the file to save to, subsurface will use the new
git save logic to save to the branch "linus" in the repository found at
"/home/torvalds/scuba".
NOTE 3: The git save format uses just the git object directory, it does
*not* check out the result in any git working tree or index. So after
you do a save, you can do
git log -p linus
to see what actually happened in that branch, but it will not affect any
actual checked-out state in the repository.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-06 21:28:39 +00:00
|
|
|
link_pkgconfig: PKGCONFIG += libzip sqlite3 libgit2
|
2013-10-07 00:52:34 +00:00
|
|
|
|
2013-10-09 22:18:51 +00:00
|
|
|
# Add libiconv if needed
|
|
|
|
link_pkgconfig: packagesExist(libiconv): PKGCONFIG += libiconv
|
|
|
|
|
2013-10-07 00:52:34 +00:00
|
|
|
#
|
|
|
|
# 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 {
|
2013-12-03 21:00:22 +00:00
|
|
|
LIBS += -lwsock32
|
|
|
|
DEFINES -= UNICODE
|
2013-10-07 00:52:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# misc
|
|
|
|
#
|
2013-10-13 13:19:54 +00:00
|
|
|
!equals(V, 1): !equals(QMAKE_HOST.os, "Windows"): CONFIG += silent
|
2013-10-07 00:52:34 +00:00
|
|
|
MOC_DIR = .moc
|
|
|
|
UI_DIR = .uic
|
|
|
|
RCC_DIR = .rcc
|
|
|
|
OBJECTS_DIR = .obj
|