Vcpkg mdl port

Hi MDL enthusiasts !

I want to share little piece of work I did to ease MDL SDK integration into your projects.

I created a vcpkg port for the MDL-SDK project.
This allow to have a simple process to build MDL-SDK from sources for a variety of configurations and platforms, resulting in a CMake package which is easy to integrate into CMake projects. [1]

Here is the workflow to get, build and use the MDL-SDK with this :

  1. set up vcpkg
    > git clone
    > <vcpkg>\vcpkg\bootstrap-vcpkg.bat

  2. set up additional vcpkg ports
    git clone <vcpkg-ports>

  3. build mdl port
    vcpkg install --overlay-ports=<vcpkg-ports>\ports --triplet x64-windows mdl

After some time that all required dependencies and MDL-SDK is built, a message summarize how to integrate it into you CMake project.

Even if redundant, here are the step to complete to integrate the built port into your projects

  1. Add -DCMAKE_TOOLCHAIN_FILE:PATH="<vcpkg>\scripts\buildsystems\vcpkg.cmake" to your CMake configure

  2. Add find_package(mdl CONFIG REQUIRED)to your CMakeLists.txt to search for the mdl built port

  3. Add target_link_libraries(<your target> PRIVATE mdl::sdk mdl::core mdl::headers) to link your target to the MDL SDK

And that’s it !

I have hooked this into Github Actions so that those get built for all currently supported configurations and platforms automatically examples here

Let me know if this is useful to anyone

There are a number of patches applied on top of the vanilla MDL-SDK repo, most of them were added so that built artefacts leverage the CMake install system and comply with the vcpkg convention for package.
But also to fix code (e.g. some missing includes) I have encoutered using Github Actions.
In the end, I made Windows and Linux pass, but not Apple as it required much more work.

[1] It is also possible to export built artefacts so that you can integrate it into any buildsystem if needed.

Thanks Andrea for sharing this. I will definitely have a look at your patches.
Our build systems do not use vcpkg AFAIK but for those who do this is valuable for sure.