KDb/Build: Difference between revisions

From KDE Community Wiki
< KDb
No edit summary
Line 25: Line 25:
  cd {predicate-build-dir}
  cd {predicate-build-dir}
  cmake {predicate-source-dir}
  cmake {predicate-source-dir}
==Building with debug information==
To build with debug infromation add '''-DCMAKE_BUILD_TYPE=Debug''' to the '''cmake''' command.
==Building with tests==
TODO
<strike>To build with tests enabled (both unit tests and functional tests), add '''-DCMAKE_BUILD_TYPE=Debug''' to the '''cmake''' command.</strike>


====Configuration for local installation====
====Configuration for local installation====
To void installing to global location like /usr, for whatever reason, for your convenience, [https://projects.kde.org/projects/playground/libs/predicate/repository/revisions/master/changes/tools/config-for-local.sh '''config-for-local.sh'''] script has been prepared with default configuration settings. You can find it in tools/ subdirectory of the source code. Use it as follows:
To void installing to global location like /usr, for whatever reason, for your convenience, [https://projects.kde.org/projects/playground/libs/predicate/repository/revisions/master/changes/tools/config-for-local.sh '''config-for-local.sh'''] script has been prepared with default configuration settings. You can find it in tools/ subdirectory of the source code. Use it as follows:


First make sure '''$KDEDIRS''' environment variable is set to directory that is you PREFIX for the local KDE 4 installation, e.g. '''$HOME/kde4/install'''. Then:
First make sure '''$PREDICATE_INSTALL_PREFIX''' environment variable is set to directory that is indended PREFIX for the local Predicate installation, e.g. '''$HOME/predicate/install'''. Then:


  mkdir -p {predicate-build-dir}
  mkdir -p {predicate-build-dir}
Line 43: Line 36:
(better pick your {predicate-build-dir} outside of the source code)
(better pick your {predicate-build-dir} outside of the source code)


  {predicate-source-dir}/tools/config-for-kde.sh {predicate-source-dir}
  {predicate-source-dir}/tools/config-for-local.sh {predicate-source-dir}
 
Note that to have the Predicate installation work environment variables PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, QT_PLUGIN_PATH should be set set properly. Double check this:
_libdir=lib # or lib64 for 64-bit platforms
export PATH=$PREDICATE_INSTALL_PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREDICATE_INSTALL_PREFIX/$_libdir:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$PREDICATE_INSTALL_PREFIX/$_libdir/pkgconfig:$PKG_CONFIG_PATH
export QT_PLUGIN_PATH=$PREDICATE_INSTALL_PREFIX/$_libdir/predicate/plugins:$QT_PLUGIN_PATH


====Configuration for re-using local KDE 4 installation====
====Configuration for re-using local KDE 4 installation====
If you use local KDE 4 installation, e.g. for developed applications, for your convenience, [https://projects.kde.org/projects/playground/libs/predicate/repository/revisions/master/changes/tools/config-for-kde.sh '''config-for-kde.sh'''] script has been prepared with default configuration settings. You can find it in tools/ subdirectory of the source code. Use it as follows:
If you use local KDE 4 installation, e.g. for developed applications, for your convenience, [https://projects.kde.org/projects/playground/libs/predicate/repository/revisions/master/changes/tools/config-for-kde.sh '''config-for-kde.sh'''] script has been prepared with default configuration settings. You can find it in tools/ subdirectory of the source code. Use it as follows:


First make sure '''$KDEDIRS''' environment variable is set to directory that is you PREFIX for the local KDE 4 installation, e.g. '''$HOME/kde4/installs'''. Then:
First make sure '''$KDEDIRS''' environment variable is set to directory that is intended PREFIX for the local KDE 4 installation, e.g. '''$HOME/kde4/installs'''. Then:


  mkdir -p {predicate-build-dir}
  mkdir -p {predicate-build-dir}
Line 57: Line 57:
  {predicate-source-dir}/tools/config-for-kde.sh {predicate-source-dir}
  {predicate-source-dir}/tools/config-for-kde.sh {predicate-source-dir}


Note that to have the Predicate installation work you need PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, QT_PLUGIN_PATH set properly. Several of these are probably already set for the local KDE 4 installation but better double check this:
Note that to have the Predicate installation work environment variables PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, QT_PLUGIN_PATH should be set set properly. Several of these are probably already set for the local KDE 4 installation but better double check this:
  _libdir=lib # or lib64 for 64-bit platforms
  _libdir=lib # or lib64 for 64-bit platforms
  export PATH=$KDEDIRS/bin:$PATH
  export PATH=$KDEDIRS/bin:$PATH
Line 63: Line 63:
  export PKG_CONFIG_PATH=$KDEDIRS/$_libdir/pkgconfig:$PKG_CONFIG_PATH
  export PKG_CONFIG_PATH=$KDEDIRS/$_libdir/pkgconfig:$PKG_CONFIG_PATH
  export QT_PLUGIN_PATH=$KDEDIRS/$_libdir/kde4/plugins:$QT_PLUGIN_PATH
  export QT_PLUGIN_PATH=$KDEDIRS/$_libdir/kde4/plugins:$QT_PLUGIN_PATH
====Configuration for debug build====
To build with debug information add '''-DCMAKE_BUILD_TYPE=Debug''' to the '''cmake''' command.
====Configuration for building with tests====
TODO
<strike>To build with tests enabled (both unit tests and functional tests), add '''-DCMAKE_BUILD_TYPE=Debug''' to the '''cmake''' command.</strike>


===Build===
===Build===

Revision as of 21:56, 19 December 2010

Template:ForDevelopers

Requirements

Required software components

  • C++ compiler, e.g. gcc
  • Qt 4.5 or newer (both libraries and development files/tools)
  • SQLite 3.6.16 or newer (both the library and development files)

Optional components

  • libpq 7.3 or newer for PostgreSQL support (both the access library and development files)

Note

PostgreSQL Server installation is not needed for building Predicate or software that uses Predicate. The server is needed only for running the actual database service. Any installaton on separate (e.g. remote) machine can be reused.


  • libmysqlclient (both the access library and development files)

Note

MySQL Server installation is not needed for building Predicate or software that uses Predicate. The server is needed only for running the actual database service. Any installaton on separate (e.g. remote) machine can be reused.


Get the source code

See the Download page. Download Predicate source code as explained on the Download page. The root directory of the source code will be referred as {predicate-source-dir}.

Build recipe

Configuration

Configuration for global installation

If you want to have Predicate installed in the global PREFIX, usually /usr, type:

mkdir {predicate-build-dir}
cd {predicate-build-dir}
cmake {predicate-source-dir}

Configuration for local installation

To void installing to global location like /usr, for whatever reason, for your convenience, config-for-local.sh script has been prepared with default configuration settings. You can find it in tools/ subdirectory of the source code. Use it as follows:

First make sure $PREDICATE_INSTALL_PREFIX environment variable is set to directory that is indended PREFIX for the local Predicate installation, e.g. $HOME/predicate/install. Then:

mkdir -p {predicate-build-dir}
cd {predicate-build-dir}

(better pick your {predicate-build-dir} outside of the source code)

{predicate-source-dir}/tools/config-for-local.sh {predicate-source-dir}

Note that to have the Predicate installation work environment variables PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, QT_PLUGIN_PATH should be set set properly. Double check this:

_libdir=lib # or lib64 for 64-bit platforms
export PATH=$PREDICATE_INSTALL_PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREDICATE_INSTALL_PREFIX/$_libdir:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$PREDICATE_INSTALL_PREFIX/$_libdir/pkgconfig:$PKG_CONFIG_PATH
export QT_PLUGIN_PATH=$PREDICATE_INSTALL_PREFIX/$_libdir/predicate/plugins:$QT_PLUGIN_PATH

Configuration for re-using local KDE 4 installation

If you use local KDE 4 installation, e.g. for developed applications, for your convenience, config-for-kde.sh script has been prepared with default configuration settings. You can find it in tools/ subdirectory of the source code. Use it as follows:

First make sure $KDEDIRS environment variable is set to directory that is intended PREFIX for the local KDE 4 installation, e.g. $HOME/kde4/installs. Then:

mkdir -p {predicate-build-dir}
cd {predicate-build-dir}

(better pick your {predicate-build-dir} outside of the source code)

{predicate-source-dir}/tools/config-for-kde.sh {predicate-source-dir}

Note that to have the Predicate installation work environment variables PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, QT_PLUGIN_PATH should be set set properly. Several of these are probably already set for the local KDE 4 installation but better double check this:

_libdir=lib # or lib64 for 64-bit platforms
export PATH=$KDEDIRS/bin:$PATH
export LD_LIBRARY_PATH=$KDEDIRS/$_libdir:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$KDEDIRS/$_libdir/pkgconfig:$PKG_CONFIG_PATH
export QT_PLUGIN_PATH=$KDEDIRS/$_libdir/kde4/plugins:$QT_PLUGIN_PATH

Configuration for debug build

To build with debug information add -DCMAKE_BUILD_TYPE=Debug to the cmake command.

Configuration for building with tests

TODO To build with tests enabled (both unit tests and functional tests), add -DCMAKE_BUILD_TYPE=Debug to the cmake command.

Build

You need to type the above configuration command only once, to configure the cmake-based buildsystem. Then just type:

 make
 make install