CopperSpice Overview
Build Process Overview

CopperSpice is built using the CMake build system. There are several configuration options available when building CopperSpice. These options can be set by passing flags when configuring the build system. Refer to Build Options for a list of supported options.

For a list of the platform specific toolchain requirements on Unix, Linux, FreeBSD, Windows, and Mac OS X refer to the Supported Platforms table.

The supported compilers on Windows are currently MinGW and MSVC.

MinGW is the Windows port of GCC. There are several versions to select, however we strongly suggest the version we used to build CopperSpice. Refer to our website, which contains links to the 32-bit and 64-bit versions.  MinGW


CopperSpice requires CMake version 3.8 or newer. For additional information about CMake refer to the following link:  CMake


Either ninja or make can be used to build C++ applications. Ninja is preferred when building CopperSpice as it is a bit faster. Ninja is also used when building our other GUI applications which use the CopperSpice libraries.

For information about downloading a pre-built binary or building ninja from source, refer to the following link:   Ninja

Build Process

For a common CopperSpice setup refer to the table below. You do not need to follow this structure, it is merely a suggestion. The source code should be placed in the cs_source directory. Building should occur in the cs_build directory, which you will need to create. The cs_lib directory will be created during the install process.

Description Directory Name
CopperSpice Source cs_source
CopperSpice Build cs_build
CopperSpice Install cs_lib

The build process consists of two basic steps.

Step 1  Configure

The following command must be run in the cs_build directory. It will configure CopperSpice for a release version. If you need to pass any CFLAGS or CXXFLAGS they can be set in your environment or passed on this command line.

There are several additional options which may be required on your system to find various third party libraries. Refer to Build Options for a partial list.

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/c/cs_lib /c/cs_source

Step 2  Compile

CopperSpice is compiled and linked by running the following command in the cs_build directory.


To install CopperSpice run the following command in the cs_build directory

ninja install

To generate a package you can use one of the following commands.

cpack -G ZIP
cpack -G TBZ2

Using a Script

As an alternative you can create a bash script which is run from the cs_build directory. This script will stop if the configuration step fails to complete successfully.

1 # add to build unit tests
2 # export CMAKE_FLAGS="-DBUILD_TESTS=on -DCMAKE_PREFIX_PATH=/c/Catch2/lib/cmake/Catch2"
4 # add to build the appropriate plugin
5 # export PostgreSQL_ROOT="/c/Program Files/PostgreSQL/10"
8 if ! cmake -G "Ninja" $CMAKE_FLAGS \
9  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/c/cs_lib /c/cs_source ; then
10 echo -e "\n\e[41m Configure CMake FAILED \e[49m\n"
11 exit 1
12 fi
14 ninja
15 ninja install