Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 1.85 KB

BUILDING.md

File metadata and controls

65 lines (47 loc) · 1.85 KB

Building with CMake

Build

This project doesn't require any special command-line flags.

Here are the steps for building in release mode with a single-configuration generator, like the Unix Makefiles one:

cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

Building on Apple Silicon

CMake supports building on Apple Silicon properly since 3.20.1. Make sure you have the latest version installed.

Install

This project doesn't require any special command-line flags to install to keep things simple. As a prerequisite, the project has to be built with the above commands already.

The below commands require at least CMake 3.15 to run, because that is the version in which Install a Project was added.

Here is the command for installing the release mode artifacts with a single-configuration generator, like the Unix Makefiles one:

cmake --install build

CMake package

This project exports a CMake package to be used with the find_package command of CMake:

  • Package name: expected64
  • Target name: expected64::expected64

Example usage:

find_package(expected64 REQUIRED)
# Declare the imported target as a build requirement using PRIVATE, where
# project_target is a target created in the consuming project
target_link_libraries(
    project_target PRIVATE
    expected64::expected64
)

Note to packagers

The CMAKE_INSTALL_INCLUDEDIR is set to a path other than just include if the project is configured as a top level project to avoid indirectly including other libraries when installed to a common prefix. Please review the install-rules.cmake file for the full set of install rules.