-
Notifications
You must be signed in to change notification settings - Fork 196
Compiling gImageReader
If you would like to compile gImageReader from source, follow these steps:
Linux (various distributions)
- Make sure you have
cmake
and a C++ compiler supportingC++11
installed. - Install the development packages of the following required build dependencies ([Gtk], [Qt5] and [Qt4] indicate dependencies required for compiling the respective gImageReader interface):
- tesseract (>=3.03.00, recommended 3.04.00 or newer)
- sane
- podofo
- [Gtk] gtkmm
- [Gtk] gtkspellmm (>=3.0.5)
- [Gtk] gtksourceviewmm
- [Gtk] cairomm
- [Gtk] poppler-glib
- [Gtk] json-glib
- [Gtk] libxml++
- [Qt5] qt5-qtbase
- [Qt5] qtspell-qt5
- [Qt5] poppler-qt5
- [Qt4] qt4
- [Qt4] qtspell-qt4
- [Qt4] poppler-qt4
For Debian based systems, the specific package names are those listed as Build-Depends
in the package control file.
For Fedora based systems, the specific package names are those listed as BuildRequires
in the package spec file
-
Configure the build: from within the extracted source tarball or git clone folder, type
$ mkdir build $ cd build $ cmake -DINTERFACE_TYPE=<type> ..
where <type>
is either gtk
, qt5
, qt4
. The qt4
interface is only recommended if your distribution does not provide Qt5 >= 5.5.0 (Qt5 < 5.5.0 suffer from QTBUG-43562 which causes gImageReader to crash).
Other standard cmake configuration options (such as CMAKE_INSTALL_PREFIX
) can also be specified, type ccmake ..
inside the build
folder to start the cmake configuration editor which lists all available configuration options.
-
Compilation: from within the created
build
directory, typemake
-
Installing: from within the created
build
directory, typemake install
-
Alternatively to installing the application with
make install
, it can also be run from within thebuild
directory.
-
For the
Qt4
andQt5
variants, it is sufficient to type from within thebuild
directory./gimagereader-qt5 # or ./gimagereader-qt4
-
For the
Gtk
variant, one needs to first add the local glib schema directory toXDG_DATA_DIRS
before running the application:export XDG_DATA_DIRS=$PWD:$XDG_DATA_DIRS ./gimagereader-gtk
Windows
Official Windows builds are cross-compiled from Fedora using its MinGW environment, which contains all required dependencies. Compilation on Windows itself has never been attempted by the author, and likely requires several dependencies to be compiled from source before even getting to compile gImageReader. Compilation from other distributions providing a reasonably complete MinGW environment might also work, though likely some build dependencies will need to be compiled first.
Cross-compiling Windows builds from Fedora
-
Install all needed dependency packages, in particular
mingw{32,64}-gcc-c++, mingw32-nsis, mingw{32,64}-twaindsm
(latter is available from this COPR repository) and the mingw variant of the dependencies listed in the package spec file (for examplegtkmm30-devel
->mingw{32,64}-gtkmm30
). If you intend to build for 32-bit Windows, you'll need theming32-*
packages, for 64-bit Windows you'll need themingw64-*
packages. -
Change directory to
packaging/win32
and run the build scriptmakeinstaller.sh
which performs the compilation and generates the installers (this script is written specifically for usage with Fedora's MinGW toolchain, so it may need tweaking when used in other distros). The script takes two optional arguments: the target architecture and the desired interface type, for example./makeinstaller.sh i686 qt5
will produce an installer for the Qt5 interface compiled for 32-bit Windows. For 64-bit Windows, use x86_64
instead of i686
.