Load translations at run time

This doesn't enable translation switching, but at least we try and load
the correct translation at startup.

We create two global pointers for the currently active translations.

This also removes the remainders of the gettext()/glib based translation
system.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Avoid the memory leaks from translations

Instead use a hash to cache the translations (and allow for the ability to
clear the hash so we can even switch translations at runtime...).

Now Qt will keep track of the memory and release it for us when we are
done with it.

This avoids the memory leak introduced in commit 4ecb35bf5ff2 ("Make a
copy of the translated text").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Implement a qmake-based build for Subsurface

This is working for me, but requires a bit more testing. To build,
run:
  qmake [options]

Where options might be:
  V=1               disable "silent" build
  LIBDCDEVEL=1      use side-by-side libdivecomputer
  INCLUDEPATH+=xxx  add -Ixxx (e.g., INCLUDEPATH+=/usr/local/marble/include)
  LIBS+=xxx         add xxx to the linker flags (e.g. LIBS+=-L/usr/local/marble/lib)
  or any other qmake option, including debug and release options

If your distribution is already using qtchooser in place of qmake, you
may need to pass an extra option to qmake to select the a
cross-build. For example:

  qmake -qt=i686-w64-mingw32-qt4

If your distribution is not yet using qtchooser, then you need to file
a bug report requesting it and you need to run the full path to qmake.

Note:
 - there are some ### left in the buildsystem
 - and version.h is generated at qmake time. It's not updated during make.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Implement updating version.h after every commit

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Remove the old buildsystem

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Compile the documentation too
Add qmake rules to install Subsurface

This is probably the most complex part of the new buildsystem. This
adds the following targets:

 - Linux:
   make install - installs to $(prefix) (default: /usr)
   The install path can be changed during make install time.

 - Windows:
   make install - installs Subsurface and its dependencies to
                  packaging/windows.

 - Mac:
   make mac-deploy     - populates Subsurface.app with the dependencies
   make install        - mac-deploy + install Subsurface.app to /Application
   make mac-create-dmg - mac-deploy + creates Subsurface-$VERSION.dmg

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Add information that goes into the Windows .exe file

And drop the unnecessary .rc file.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
And let qmake create the Mac bundle on its own

It will even parse the Info.plist.in file for us and run sed on it.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Add a tool to scan for dependencies on Windows

Similar to ldd on Linux.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Update the README and create an INSTALL file.

Let the README contain generic information and move the build
instructions to the INSTALL file.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Speed up win-ldd by not reading the full output of objdump

We can stop after the import table dump is done. We don't need to read
the entire relocation table and the export table.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Disable the code that tries to find an alternate objdump

On Linux distros, it seems, objdump is configured to read Windows
executables (BFD architecture "pei-i386"), so we don't need to find an
alternate / cross-compile version. But leave the code here in case we
run into a distro that does things differently.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Use the $PATH environment variable to pass extra dirs for DLLs

Unix developers, look away... this is how it's done on Windows: the
binary loader searches $PATH for the DLLs, so let's reuse the same
variable. This simplifies the command-line a little.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Add support for parsing more than one binary in win-ldd

We're going to need this to deploy Qt and Marble plugins.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Deploy some Qt plugins alongside the binary

Only implemented for Windows for now. On Mac, macdeployqt copies all
imageformat plugins on its own.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Fix the Marble data installation for Windows

Qt-only Marble expects the data to be on applicationDirPath() + "/data".

Signed-off-by: Thiago Macieira <thiago@macieira.org>