Building Rivet 3.0 with CMake

CMake build procedure and examples

Starting with 3.0 Rivet has adopted CMake as an alternate build system. The choice of introducing CMake was motivated by the need of an easy to use and reliable build system for Windows installations. Nonetheless the usability of CMake is by no means restricted to that OS and user familiar with this tool set can adopt it to build mod_rivet also on Linux and other systems. The current CMake script requires CMake 3.2 or later. The CMake documentation page has a complete reference of CMake features

Before running the build script cd into the cmake directory

cd cmake

With default arguments run the following sequence of commands that prepare the build directory build the code and install the binary and application library

cmake -E make_directory build
cmake -E chdir build cmake ..
cmake --build build --target all --clean-first
cmake --build build --target install

Installation on a Windows system with a custom installation of the Apache HTTP web server

cmake -E make_directory build
cmake -E chdir build cmake -DAPACHE_ROOT=G:/Apache24 ..
cmake --build build --config Release --target install

Building rivet on Windows with a 64 bit build of Apache requires specific directives to the Microsoft C compiler

cmake -E make_directory build_64
cmake -E chdir build_64 cmake -DAPACHE_ROOT=G:/Apache24 -G "Visual Studio 15 2017 Win64" ..
cmake --build build_64 --config Release --target install

-G "..." can be set to any of the available 64-bit generators available under the platform depending on your Windows version and Apache build