← All install guides

01 / C++ INSTALL

Build the C++
libraries.

Configure CoolBox with CMake, build its C++ libraries, then install the exported CMake package so another project can find and link CoolBox targets.

10 MINC++17 + CMAKEINTERMEDIATE

Before you begin

Install Git, CMake 3.12 or newer, and a C++17-compatible compiler. On Windows, use a Visual Studio C++ toolchain; on macOS or Linux, install the compiler toolchain for your distribution.

Check that the tools are available:

TERMINAL
cmake --version
git --version

1. Clone the repository

Clone CoolBox with its tracked submodules so all required source repositories are checked out:

TERMINAL
git clone --recurse-submodules https://github.com/MeanderingAI/CoolBox.git
cd CoolBox

2. Configure the build

From the repository root, configure a build directory and enable installation of the CMake package:

TERMINAL · REPOSITORY ROOT
cmake -S . -B build -DCOOLBOX_INSTALL_PACKAGE=ON

CMake detects the available compiler and generates the build files for your platform.

3. Build CoolBox

Build the configured project. The --config option works with multi-configuration generators such as Visual Studio and is also accepted by common CMake generators:

TERMINAL
cmake --build build --config Debug

4. Install the libraries and package

Choose an install prefix you can write to. For PowerShell, this installs under your user profile:

POWERSHELL
cmake --install build --config Debug --prefix "$HOME\CoolBoxInstall"

On macOS or Linux, you can use a folder under your home directory instead:

MACOS / LINUX
cmake --install build --config Debug --prefix "$HOME/.local/coolbox"

5. Link CoolBox from another CMake project

In a consumer project, find the installed package and link the targets you use. This is the documented pattern for the deep-learning library:

CMAKE
find_package(CoolBox CONFIG REQUIRED)
target_link_libraries(your_app PRIVATE CoolBox::deep_learning)

If CMake cannot locate the package, set CMAKE_PREFIX_PATH to the install prefix used above. See the CoolBox build instructions for the latest options and supported targets.