KLATEXFORMULA
Home
About
Downloads
Screen Shots
Wiki (Manuals)
News

User Manual:Qmake compilation options

From KLFWiki

Jump to: navigation, search

NOTE: THIS ARTICLE APPLIES TO THE OLDER KLATEXFORMULA VERSION 3.1 ONLY. For compilations options since the newer klatexformula 3.2, refer to User Manual:CMake compilation options.

qmake as configure program

KLatexFormula 3.1 uses Qt's qmake build system.

Note: I had to introduce many hacks and workarounds for various features I wanted, resulting in a pretty ugly general structure as of now. I may switch to a better build system in a future version of KLatexFormula.

Configuring the build environment is done by passing variable values to qmake. The complete list is detailed here.

qmake variable options

Options are passed to qmake in the form of variable values, for example:

qmake QMAKE=/usr/bin/qmake BACKEND_SHAREDORSTATIC=dll INSTALLPREFIX=/usr/local

will compile klfbackend as a dynamic library and install klfbackend library and klatexformula to /usr/local/lib and /usr/local/bin respectively.

  • QMAKE=/path/to/qmake : qmake program (in $PATH or with explicit path). Defaults to "qmake"
  • RCC=/path/to/rcc : rcc program (in $PATH or with explicit path). Defaults to "rcc"
  • BACKEND_ONLY=<yes|> : if a non-empty string is provided (e.g. "yes") then only the backend library will be built (and thus not the GUI program). You must pass this option if you are compiling with Qt 3.
  • BACKEND_INSTALLPREFIX=/installation/prefix : specify installation prefix, ie. where to install the backend library with 'make install'. Defaults to the value of the INSTALLPREFIX option.
  • BACKEND_INSTALLLIBDIR=/path/to/libdir/lib|/path/to/libdir/lib64 : specify library installation directory, including the lib or lib64 directory. Typically "/usr/lib" or "/usr/lib64". Defaults to "$BACKEND_INSTALLPREFIX/lib", or "$BACKEND_INSTALLPREFIX/lib64" if (uname -m) contains '64'. This option is new in version 3.1.2. Versions 3.1.0 and 3.1.1 use BACKEND_LIBDIR which should be set to 'lib' or 'lib64'.
  • BACKEND_SHAREDORSTATIC=staticlib|dll : set this option to "staticlib" if you want to compile a static klfbackend library or "dll" for a shared library. Defaults to staticlib
  • BACKEND_USE_QT4=true|false : This variable exists because I'm lazy and don't want to parse the contents of $$QT_VERSION in qmake files. Set to true if you're compiling with Qt4 or set to false if you're using Qt3. Note: We MUST be using Qt4 if we're building the GUI too. Defaults to Qt4 ("true").
  • SRCLIB_SHAREDORSTATIC=staticlib|dll : whether to build a static source library (internal, non-installed library containing all klatexformula source except main function and its auxiliaries). "staticlib" is the default because there is no need for a dynamic library but on some systems setting this value to "dll" is required for plugins referencing main code to compile. Warning: see note below.
  • INSTALLPREFIX=/installation/prefix : installs klatexformula to this location, and sets the default value of BACKEND_INSTALLPREFIX to this value. More specifically, install executable in /prefix/bin, desktop file in /prefix/share/applications/klatexformula.desktop, icons in /prefix/icons/... etc.. Defaults to "/usr"
  • ICONTHEME=icon-theme : in which icon theme to install our pixmaps. Defaults to "hicolor"

Notes

  • If, in src/plugins/*/*.pro the plugins are explicitely linked to the source library (-lklfsrc, this is the default on windows and mac, but not on linux), then you must build a shared (dynamic) library, otherwise some global symbols defined in the sources will be loaded twice, causing klatexformula to dysfunction or crash.
  • If you decide to change the installation directory, or if you change the values for some variables above, it may be necessary to remove all Makefile's for the changes to be applied. E.g. run in klatexformula's directory:
     rm `find . -name Makefile*`
    to delete all makefiles found recursively in this directory. Then run qmake again with your new options.