<pre data-lang="cmake" data-label="CMake, FetchContent"># CMakeLists.txt
include(FetchContent)
FetchContent_Declare(
  libstb
  GIT_REPOSITORY https://github.com/MohammadRaziei/libstb.git
  GIT_TAG        master
)
FetchContent_MakeAvailable(libstb)

target_link_libraries(my_app PRIVATE libstb::libstb)</pre>
<pre data-lang="cmake" data-label="CMake, pip (prebuilt)"># CMakeLists.txt
execute_process(COMMAND libstb --cmake-dir
                OUTPUT_VARIABLE libstb_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
                COMMAND_ERROR_IS_FATAL ANY)
find_package(libstb CONFIG REQUIRED)

target_link_libraries(my_app PRIVATE libstb::libstb)</pre>
<p class="install-note">CMake 3.21+ and a C++17 compiler. Include <code>&lt;stb.h&gt;</code> and link <code>libstb::libstb</code> (a shared library; the stb headers are never exposed). Also available through <code>find_package(libstb CONFIG)</code> after <code>cmake --install</code>.</p>
