Commit graph

106 commits

Author SHA1 Message Date
Tomaz Canabrava
d84ffa8fc3 Move WeightModel to qt-models
One more step to make it easyer to port the app to Mobile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:11:12 -07:00
Tomaz Canabrava
a0f3c9992c Move WeigthSystem Info model to qt-models
This is another effort to make it easyer for the mobile
interface of Subsurface.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:10:50 -07:00
Tomaz Canabrava
32b0afa3e7 Move Tankinfomodel to its own file
Another change to make it easier to program the mobile ui. This was a
fairly easy patch: just moved the contents of the file and fixed the
includes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:10:30 -07:00
Tomaz Canabrava
f432b764e7 Move DivePlannerModel and CylinderModel to qt-models
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.

A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.

I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:09:13 -07:00
Tomaz Canabrava
6e4aa7d044 Move CleanerTableModel to its own file
models.h / .cpp was getting too big (around 2.5k lines), and each change
triggered a rebuild in tons of parts of Subsurface, this is the first
commit trying to make the models code sane by removing them all of the
models.h/cpp file and also clearning code in the process.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:08:36 -07:00
Tomaz Canabrava
338c0f22aa Move the models to its own folder
This is an attempt to help share code between the desktop version of
Subsurface and the mobile version.
More code will be moved around and the models will be split in a way that
will help recompile times and also creation of different interfaces for
different form-factors.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-29 14:07:54 -07:00
Dirk Hohndel
95664af53b Add USE_LIBGIT23_API as cmake option
Just as we would expect, the libgit2 developers of course once again broke
their API. In order to compile against current master we need to remap
those APIs once again.

Simply call cmake with -DUSE_LIBGIT23_API

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 09:13:51 -07:00
Tomaz Canabrava
0fdb87b011 Use group of files to show the project hierarchy
This doesn't work on QtCreator yet - but it's the documented way in CMake
to display the project hierarchy in some IDEs (the one that I know that it
works with is Visual Studio). Even knowing that this doesn't work with
QtCreator, it's a valid change because someone can fix creator in the
future.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-25 17:10:41 -07:00
Tomaz Canabrava
b59084dc1f Add a new class, QtWaitingSpinner, MIT Licensed.
from https://github.com/snowwlex/QtWaitingSpinner

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 15:00:25 -07:00
Tomaz Canabrava
5eb572b9c6 Move Locationinformation to its own file.
The SimpleWidgets file was getting too big, and location information will
also need a new model - a good way to do not mix everything is to put
things in a new file.

[Dirk Hohndel: added missing include of stdint.h]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-17 13:51:13 -07:00
Dirk Hohndel
e491f4a0db cmake: enable Facebook support
Not sure if we have this on Android, so right now I just enable it for
Linux, OS X, and Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-01 19:17:22 -07:00
Dirk Hohndel
7704ed31ff cmake: missing space
This caused cut to fail and the whole dll dependency calculation went
wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-28 13:40:18 -07:00
Tomaz Canabrava
34c88f9a15 CMake needs hints that this will be a win32 or a mac bundle.
MACOSX_BUNDLE and WIN32 give hints to cmake for different
install behaviors. for instance, trying to copy frameworks
and other stuff to the correct places.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-26 12:17:17 -07:00
Dirk Hohndel
ac34413a35 cmake: don't always build tests
Only build the tests when running them. The downside of the way this is
implemented is that build errors for the tests actually show up as test
errors and are only seen in the test log - but this seemed worth not
having every build include the tests.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 11:23:50 -07:00
Dirk Hohndel
38ba7177c7 cmake: copy images / icons into the build Documentation folder
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 11:02:45 -07:00
Dirk Hohndel
c97e136435 cmake: include the git SHA in the Windows installer name
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24 07:18:11 -07:00
Dirk Hohndel
164170cfdf cmake: fix finding Marble
Silly bug. A lot of things in cmake are case insensitive. Some care about
case. Stupid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-21 18:19:16 -07:00
Lubomir I. Ivanov
82ff9fc9c8 cmake: more consitent multi-line calls
- don't put anything on the first line after the opening "("
- fix indentation of the closing "("

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-18 08:02:32 -07:00
Lubomir I. Ivanov
8fec4ab5e7 cmake: use uppercase for defined macros
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-18 08:02:23 -07:00
Lubomir I. Ivanov
8153c1560b cmake: fix message for NO_MARBLE
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-18 08:02:07 -07:00
Lubomir I. Ivanov
ea2ffd6c32 cmake: lowercase all built-in calls
e.g.
SET() -> set()
ELSEIF() -> elseif()

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-18 08:01:36 -07:00
Lubomir I. Ivanov
8c4ef161b2 cmake: generate clean ssrf-version.h
remoevs the extra white sapce in the generated
ssrf-version.h.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-18 08:01:14 -07:00
Lubomir I. Ivanov
cdd84bb188 cmake: whitespace cleanup
- indentation
- spaces near comments

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-18 08:00:17 -07:00
Lubomir I. Ivanov
ed4fbb92d0 cmake: add LIBGIT2_FROM_PKGCONFIG and LIBDC_FROM_PKGCONFIG
These two new options allow usage of pkg-config to retrieve
libdivecomputer and libgit2.

For some reason the variables *_LIBRARIES have to be set
to blank strings in the process, otherwise "-l" is passed to
the linker.

LIBGIT2_FROM_PKGCONFIG is a rename from PREFER_GIT_FROMSOURCE
for consistency. The IF() check is also fixed.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-17 15:25:47 -07:00
Lubomir I. Ivanov
39d0b5533d cmake: add the NO_MARBLE option
If NO_MARBLE is set to ON, the MARBLE package is not seeked.
If set to OFF the package is seeked, but if the find fails
the gcc definition -DNO_MARBLE is set and marble is disabled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-17 15:25:33 -07:00
Lubomir I. Ivanov
1c71a90826 cmake: add the NO_TESTS NO_DOCS options
NO_TESTS: disable the tests
NO_DOCS: disable the docs

Both are set to OFF by default.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-17 15:24:51 -07:00
Dirk Hohndel
6662f2864f cmake: fix bug when using system libgit2
Simple omission in commit 7596db28b5 ("cmake: allow looking for optional
libraries").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-16 07:25:49 -07:00
Dirk Hohndel
5ecf4650b4 cmake: add extra -lpthread to fix Ubuntu builds
We shouldn't need this. Ubuntu is once again broken. What else is new.
But since this shouldn't hurt any of the sane Linux version, I'll just add
it for any Linux flavor.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-16 07:22:09 -07:00
Tomaz Canabrava
8e32faa866 cmake: remove references to LRELEASE
This is being taken care by Qt5::LinguistTool

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-14 10:28:58 -07:00
Dirk Hohndel
12b276d15c cmake: try to find the macdeployqt program
There is no variable for it, but we can abuse the variable that shows us where
moc is located.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-10 13:15:19 -07:00
Dirk Hohndel
6f997274f9 cmake: improve test for variable
CMake still confuses me. When testing if a variable was set it sometimes needs
to want "DEFINED", but sometimes I need to compare it to an empty string. Let's
do both (this seems to fix the problem I ran into) - but this is still weird.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-10 12:10:07 -07:00
Dirk Hohndel
7596db28b5 cmake: allow looking for optional libraries
And use this to look for libusb.
If it's there then libdivecomputer likely was linked against it. If it isn't
then we don't need it, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-10 12:08:26 -07:00
Tomaz Canabrava
a8d06b848e Move the translations to it's own subfolder
By adding a new CMakeLists.txt file and configuring
the translations inside of it's folder, the buildsystem
will compile everything on that folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-09 11:57:30 -07:00
Tomaz Canabrava
1a662df648 Use Qt5Translations to deal with translations
And remove the old code that did the same thing in
a very complex way.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-09 11:16:44 -07:00
Tomaz Canabrava
a56c0f227d We use static library if we find - option was not being used.
Currently we search for a static library and if we don't
find it, we search for a shared library. If one of them
is found, we return success but if none of them is found,
error. So - A static library for libgit and libdivecomputer
is preferred over the shared one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-09 11:16:30 -07:00
Dirk Hohndel
d6dc1d01df cmake: fix typo
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 20:49:21 -07:00
Tomaz Canabrava
c2bdc58fb8 Make it compilant with the build script
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:39 -07:00
Tomaz Canabrava
6f93590705 Add FindLibdivecomputer.cmake
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:27:39 -07:00
Tomaz Canabrava
46990f4ac8 Simplify libgit handling on main CMakeLists.txt
We will use the OPTIONS variable to decide to find the
.a or the .so, so there's no need to do checks here.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:09:35 -07:00
Tomaz Canabrava
5a9931f438 Add build options
- add an option to toogle between libgit2 from package vs built from source
- add two options that will be used in the future: use static/dynamic lib

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:08:55 -07:00
Tomaz Canabrava
2e05dbb791 No need to specify Marble dir anymore
We are already looking for the default directory.
*if* cmake doesn't find Marble automatically, the user needs
to specify -DMARBLE_INCLUDE_DIR and -DMARBLE_LIBRARIES

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:07:33 -07:00
Tomaz Canabrava
057231701e Move the pkg_config_library macro to its own file
The pkg_config_library macro is a helper macro and was generating noise
on the main CMakeLists.txt file, so I moved it to another file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:07:07 -07:00
Tomaz Canabrava
e56580229b FindMarble moved to cmake/Modules
This is the correct way to deal with CMake Modules (or at least, the
default way). All our custom CMakeFiles will be here.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:06:54 -07:00
Tomaz Canabrava
85fbd1737c Simplify finding Qt
Qt5 Supports Components, which means that we can list the
components we need to find, instead of specifying one for
each line.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-07 16:06:44 -07:00
Dirk Hohndel
143ecbf7a2 cmake: second attempt to install our ssrfmarble lib
Sorry for the noise.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 21:10:40 -07:00
Dirk Hohndel
f8a01ee309 cmake: on Linux install our special marble library
If we build our own library, make sure it gets installed as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 20:19:02 -07:00
Dirk Hohndel
5722d5f0dc cmake: add libz to end of linker line on Linux
While I don't need this when building on Fedora 20, OBS builds for
openSUSE appear to fail without this. Strange.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 17:41:35 -07:00
Dirk Hohndel
f07ba421d1 cmake: the application name should be capitalized on Mac
We want Subsurface.app but subsurface and subsurface.exe

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-05 06:53:17 -07:00
Dirk Hohndel
ce3a169cf9 cmake: try to get the dependency on the .qm files right
This is still not something I'm 100% sure I got right. But at least now it
correctly rebuilds the .qm files...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 21:59:51 -07:00
Dirk Hohndel
e8955e5916 cmake: use the correct macdeployqt command name
Oops, that was silly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04 16:30:46 -07:00