deps_src/README_CMAKE_INTERFACES.md
This document describes how to use the CMake interface libraries created for the subdirectories in deps_src/.
semver or semver::semversemver.htarget_link_libraries(your_target PRIVATE semver)
# or
target_link_libraries(your_target PRIVATE semver::semver)
hintshintsToPot executabletarget_link_libraries(your_target PRIVATE hints)
stb_dxt or stb_dxt::stb_dxtstb_dxt.htarget_link_libraries(your_target PRIVATE stb_dxt)
# or
target_link_libraries(your_target PRIVATE stb_dxt::stb_dxt)
add_executable(my_app main.cpp)
target_link_libraries(my_app
PRIVATE
semver::semver # For version parsing
stb_dxt::stb_dxt # For DXT texture compression
hints # For hints functionality
)
// For semver
#include <semver.h>
// For stb_dxt
#include <stb_dxt.h>
// Use the libraries as documented in their respective headers
spline::spline) for clarity-fPIC for compatibilityHere's a complete example of using these libraries in a new component:
# In src/mycomponent/CMakeLists.txt
add_library(mycomponent STATIC
mycomponent.cpp
mycomponent.h
)
target_link_libraries(mycomponent
PUBLIC
semver::semver # Version handling is part of public API
PRIVATE
stb_dxt::stb_dxt # Used internally for texture compression
)
target_include_directories(mycomponent
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
semver library produces a static library that will be linked into your targethints project also produces a hintsToPot executable utility