The buildsystem used is cmake. Use it like any other cmake project, it will probably work.
This is the standard procedure i use:
- clone repository, change into it
- create build dir and change to it:
mkdir build; cd build
- run cmake:
- adjust cmake vars:
sudo make install
Instead of using
sudo make install you can also build a package.
For that see "Building a Package".
These are normal cmake variables.
You can set them interactively by using
ccmake . in your build directory.
Alernatively specify the variables
VAR with the value
VALUE like this when invoking cmake:
cmake -DVAR=VALUE ..
-D multiple times to set multiple variables.
To customize your smplxmpp build, the following variables are at your disposal.
||whether developer documentation should be built||
||type of build (mainly whether to include debug symbols)||
||prefix to all stuff smplxmpp install to, typical values apart from the default could be
||whether to build the smplxmpp binary||
||path to additional ca certs file (only one) that should always be loaded||empty|
||if the system gloox is not used: path (file or URL) to gloox source (may be a tarball)||
||if the system gloox is used: linker flag to gloox||
||whether to use gloox provided by the system||
||gzip man pages before installing (strongly recommended)||
||whether to install the smplxmpp binary. if OFF, the built binary will stay only in the build directory||
||whether to build the smplxmpp-nl binary||
||whether to install the smplxmpp-nl binary. if OFF, the built binary will stay only in the build directory||
||whether smplxmpp should install a license. if your distribution already provides a copy of the GPLv3, you may set this option to false||
||whether to install the man pages for smplxmpp (section 1 & 5)||
||whether to install the man page for smplxmpp-nl||
||directory where the license is installed||
||name of the license file||
||iff ON, use the spdlog version supplied by the system (recommended)||
||whether to use the target
||path/URL to spdlog source when not using system spdlog||
||whether to guess the version by counting commits since the latest version. otherwise use hard-coded values (defaulting to current release)||
||set to overwrite default version. useful for packaging||guessed (see below)|
||unix timestamp of the current version. will try to get from git if enabled or use hard-coded value of last version||
All variables are set to sensible defaults: if you don't know what they mean, simply don't touch them and you should be fine.
Building a Package
make package after building to create a debian package.
Note that the package respects the
CMAKE_INSTALL_PREFIX, so despite being a package, all files will go to
/usr/local by default.
So when building a package, make sure to change the install prefix like so:
mkdir build; cd build cmake -DCMAKE_INSTALL_PREFIX=/usr .. make -j8 make package
Note that the gloox source is compiled and downloaded at build time.
make requires an active internet connection.
When building from a git repo, the repo's tags and the date of the last commit will be used to calculate date and version of smplxmpp. As fallbacks the data from the latest minor release will be used. (It is not read from git but loaded from a file, where it is hardcoded.)
The version is constructed as follows:
Get latest version as set in
If the current commit is a tag
$version, else use
$revcnt the count of commits since tag
$shorthash as the short SHA1 hash of HEAD.
Therefore valid version numbers might be
To bump the version, execute:
- bump version in
- update timestamp in
- commit & tag the commit
$versionwith the exact string from
- push commit and tag
You can disable version guessing by switching
If you want to specify your own version identifier, for example during packaging, specify
SMPLXMPP_VERSION_DATE (as unix timestamp, month & year are calculated during build).
By default gloox is linked dynamically from the version provided by the distribution.
By adjusting the build variables it can be downloaded, rebuilt and linked against statically:
OFF, cmake will handle the download and build.
Similarly to gloox you can either use spdlog provided by your system (recommended, default) or download & recompile spdlog during build: Set
If you use your system spdlog version (recommended), you need spdlog in your include path.
Depending on your spdlog version it may be a header only or a shared library.
SMPLXMPP_SPDLOG_FORCE_HEADER_ONLY is set to
ON, the special target
spdlog::spdlog_header_only will be used for linking.
As this target is not available on versions without spdlog as shared library, activating this option will fail on these systems.