Advice on Combining CHAI3D and OpenSim with CMake

Hi,

I’m working on a C++ project where I need to use both CHAI3D (for haptics) and OpenSim (for simulation). Each library has its own CMake setup, and I’m trying to combine them into a single CMake project on Windows 11 using the Visual Studio generator.

Could you please suggest the best approach to set this up?

OpenSim is a normal CMake project, you can build and install it as with any CMake project and then discover it with find_package().

CHAI3D is very far from a modern package. It produces a CMakeConfig but does not install it, instead the whole package uses runtime output directories and export() to make itself available. You will need to build CHAI3D and point chai3d_ROOT at the resulting build directory to discover it with find_package().

Once discovered with find_package() you will be able to link to their exported targets with target_link_libraries().