This document walks you through building Touca SDK for C++ and its side components from its source code. Refer to our Installing Instructions to learn how to pull Touca as a third-party dependency.
You can build Touca on Linux, macOS, and Windows platforms. We support C++11 and newer standards. We use CMake as our build system. You would need CMake v3.14 or newer to build Touca. We formally support the following compilers:
Obtaining the Source Code
Touca SDK for C++ is available
on GitHub under the
Apache-2.0 license. Clone this repository to a directory of your choice. We
refer to this directory as
git clone firstname.lastname@example.org:trytouca/trytouca.git
Using Our Helper Script
Touca SDK for C++ has five main components.
|Sample Regression Test Tools|
|Utility Command Line Tool|
We provide build scripts
build.bat for Unix and Windows
platforms, respectively. The build scripts build the core library and the test
framework by default. You can pass the appropriate argument shown in the table
above to build other components as needed.
As an example, the command below builds all the components except the unit tests.
./build.sh --with-cli --with-examples
You can build all of the components using the
Using CMake Directly
If, for any reason, you do not want to build Touca using our helper scripts, you
can always use CMake directly. To do so, we recommend running the following
command first, to configure the build targets and specify the path in which
build artifacts should be generated. While you can change the build directory to
the directory of your choice, the subsequent instructions assume the default
cmake -B"<project_directory>/local/build" -H"<project_directory>"
By default, the above-mentioned command configures CMake to build the core Touca Client Library. But Touca has several other components that can be enabled by passing the appropriate options to the command above, as listed in the table below.
|Component Name||CMake Option||Default|
|Sample Test Tools||OFF|
As an example, the command below enables building sample Touca tests.
cmake -B"<project_directory>/local/build" -H"<project_directory>" -DTOUCA_BUILD_EXAMPLES=ON
We can build the source code via CMake which uses the native build tool of your platform.
cmake --build "<project_directory>/local/build" --parallel
Optionally, as a last step, we can install the build artifacts in a directory of our choice for easier packaging.
cmake --install "<project_directory>/local/build" --prefix "<project_directory>/local/dist"