Building ink
Requirements
C++17 compiler (GCC, Clang, or MSVC)
CMake 3.16+
Optional: OpenGL + GLEW (for GL backend)
Optional: Metal framework (macOS, for Metal backend)
Test-only: Google Test (fetched automatically via CMake FetchContent)
Build Options
Option |
Default |
Description |
|---|---|---|
|
|
Enable OpenGL 3.3+ backend |
|
|
Enable Metal backend (macOS only) |
|
|
Enable Vulkan backend (planned) |
|
|
Build the Google Test suite |
|
|
Build example programs |
|
|
Build as shared library |
Common Build Configurations
CPU-only (no GPU dependencies):
cmake -B build -DINK_ENABLE_GL=OFF
cmake --build build -j$(nproc)
With OpenGL and tests:
cmake -B build -DINK_ENABLE_GL=ON -DINK_BUILD_TESTS=ON
cmake --build build -j$(nproc)
ctest --test-dir build --output-on-failure
With examples:
cmake -B build -DINK_BUILD_EXAMPLES=ON
cmake --build build -j$(nproc)
Integration
As a CMake subdirectory:
add_subdirectory(third_party/ink)
target_link_libraries(my_app PRIVATE ink)
Manual: Add include/ to your include path and link against the built
library (libink.a or ink.lib).
Building Documentation
To generate the full documentation (Doxygen API reference + Sphinx guides):
cmake -B build
cmake --build build --target docs
This runs Doxygen first (producing XML + standalone HTML), then Sphinx
(producing the combined documentation site). Output is in
docs/_build/sphinx/.
You can also run the tools manually:
# Doxygen only
doxygen Doxyfile
# Sphinx only (requires Doxygen XML to exist)
sphinx-build docs docs/_build/sphinx