Skip to content

Compiling gImageReader

Sandro Mani edited this page Dec 15, 2017 · 23 revisions

If you would like to compile gImageReader from source, follow these steps:

Linux (various distributions)

  1. Make sure you have cmake and a C++ compiler supporting C++11 installed.
  2. 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
  • libjpeg
  • djvulibre
  • [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-Dependsin the package control file.

For Fedora based systems, the specific package names are those listed as BuildRequires in the package spec file.

  1. 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.

  1. Compilation: from within the created build directory, type

     make
    
  2. Installing: from within the created build directory, type

     make install
    
  3. Alternatively to installing the application with make install, it can also be run from within the build directory.

  • For the Qt4 and Qt5 variants, it is sufficient to type from within the build directory

       ./gimagereader-qt5 # or ./gimagereader-qt4
    
  • For the Gtk variant, one needs to first add the local glib schema directory to XDG_DATA_DIRS before running the application:

       export XDG_DATA_DIRS=$PWD:$XDG_DATA_DIRS
       ./gimagereader-gtk
    

Windows

The easiest way to compile gImageReader for Windows is by using the provided Docker image, performing the following steps from the root directory of the gImageReader source tree:

  1. Build the image (only required once resp. periodically to update it):

    docker build -t gimagereader_buildenv packaging/win32
    
  2. Compile gImageReader and build the installers:

  • 32-bit build:

    docker run -v $PWD:/workspace gimagereader_buildenv packaging/win32/makeinstaller.sh i686 qt5
    
  • 64-bit build:

    docker run -v $PWD:/workspace gimagereader_buildenv packaging/win32/makeinstaller.sh x86_64 qt5
    
  1. The built installers can then be found inside the build trees:
  • 32-bit build: build/mingw32-qt5/gImageReader_$VERSION_qt5_i686.exe
  • 64-bit build: build/mingw64-qt5/gImageReader_$VERSION_qt5_x86_64.exe

Clone this wiki locally