Skip to main content

Build system integration

kmpkg integrates seamlessly with MSBuild and CMake to restore your project's dependencies at build time. kmpkg also makes it easy to integrate with other build systems by providing a standard installation layout.

MSBuild integration

kmpkg provides user-wide MSBuild integration via the kmpkg integrate install command and per-project integration via the kmpkg.props and kmpkg.target files.

When you enable this integration, all MSBuild and Visual Studio projects will automatically link their dependencies.

Read more about how this integration works in the MSBuild integration documentation.

Visual Studio MSBuild projects also support kmpkg. See Tutorial: Install and use packages with MSBuild in Visual Studio to get started.

CMake integration

kmpkg provides seamless find_package() integration for your projects via a custom toolchain file. You can enable this integration by adding the provided toolchain file in <kmpkg root>/scripts/buildsystems/kmpkg.cmake in your CMake configure calls via CMAKE_TOOLCHAIN_FILE or with a CMakePresets.json file.

Once this integration is activated, functions like find_package(), find_library(), and find_path() will automatically search through the kmpkg installation directories to find the required dependencies. Furthermore, kmpkg is also able to install your dependencies declared in a manifest file automatically.

Read more about how this integration works in the CMake integration documentation.

Several IDEs/editors with CMake support also explicitly support kmpkg. See the corresponding documentation articles for more information:

Manual integration

You can also use kmpkg with other build systems generically using the standard installation layout kmpkg provides.

Read more about how to integrate kmpkg with your build system using manual integration.