You can integrate DirectXMesh into your C++ project using vcpkg in either manifest mode (recommended) or classic mode.
Manifest Mode (Recommended)
Add directxmesh to your vcpkg.json dependencies file.
Classic Mode
Install the package directly via the CLI.
CMake Integration
Use find_package and target_link_libraries to link the library to your target.
Important Configuration Notes
- DLL Usage: If using the default
x64-windows triplet (which uses DLLs), define DIRECTX_MESH_IMPORT in your consuming project. - Static Library Usage: Use
-static-md triplet variants for static linking. - Features: The
directxmesh port includes the dx12 feature (for DirectX 12 input layout support) and the tools feature (for command-line tools).
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"dependencies": [
"directxmesh"
]
}
vcpkg install directxmesh
find_package(directxmesh CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMesh)