CMake

From Wzdftpd

Jump to: navigation, search

Contents

Configuring the project

Unlike the automake project, the cmake project must be configured in a separate directory, the build directory.

Linux/BSD

Create the build directory, enter it, and run cmake <options> path_to_source_directory

mkdir build
cd build
cmake -DDEBUG=1 -DWITH_GNUTLS=NO ../

Common options

To use these options, pass the -Doption[=value] to cmake.

  • WITH_GnuTLS
  • WITH_MYSQL
  • WITH_OpenSSL
  • WITH_PerlDev
  • WITH_PostgreSQL
  • WITH_TCLDev
  • WITH_Zeroconf
  • WITH_IPV6
  • WITH_UTF8
  • WITH_TESTS

Be carefull with these options, they are put in cache to speed up the configuration part. If you want to redo a clean configuration, remove the file CMakeCache.txt in the build directory, or wipe out the build directory entirely.

You can also try to edit the cache directly (make edit_cache), but this requires some knowledge of what you're doing.

Choosing the installation directory

Add the option -DCMAKE_INSTALL_PREFIX=/opt/wzdftpd when running cmake.

Make compilation more verbose (linux/bsd)

By default, cmake will hide you the details of the compilation, and just print the name of the files being built. However, if you want to see the command lines, add the -DCMAKE_VERBOSE_MAKEFILE=1 option.

Compilation

Just run make as usual. cmake generated Makefiles seems fairly compatibles with BSD make.

Installation

Run make install.

Tests

wzdftpd comes with a test suite, to ensure that most of the critical functions will work on your system.

To run all the tests, use make test. You need to ensure you have not disabled the tests when configuring (-DWITH_TESTS=OFF).

Current Problems

OpenBSD

On OpenBSD, cmake does not set the rpath options correctly, so the test suite won't work, and you can't run the binaries directly. Workaround: set LD_LIBRARY_PATH to the directory containing libwzd_core.so

Personal tools
documentation