Skip to content

Instantly share code, notes, and snippets.

@adamkewley
Last active January 13, 2026 15:49
Show Gist options
  • Select an option

  • Save adamkewley/ab536689266051a181927d9eb9ed6d3e to your computer and use it in GitHub Desktop.

Select an option

Save adamkewley/ab536689266051a181927d9eb9ed6d3e to your computer and use it in GitHub Desktop.
Build OpenSim Creator for downstream C++ projects
# !!!! WARNING: THIS ISN'T OFFICIAL IN ANY WAY: DON'T COME CRYING TO ME IF YOUR C++ BREAKS !!!!
# # Before: get source code and enter directory:
#
# git clone https://github.com/ComputationalBiomechanicsLab/opensim-creator
# cd opensim-creator/
build_type=Release
build_dir=${PWD}/build
install_dir=${PWD}/install
# Build + install dependency libraries + headers
cmake -G Ninja -S third_party/ -B ${build_dir}/third_party -DCMAKE_BUILD_TYPE=${build_type} -DCMAKE_INSTALL_PREFIX=${install_dir} -DBUILD_TESTING=OFF
cmake --build ${build_dir}/third_party
# Build + install libopensimcreator library + headers
cmake -G Ninja -S . -B ${build_dir} -DCMAKE_BUILD_TYPE=${build_type} -DCMAKE_INSTALL_PREFIX=${install_dir} -DBUILD_TESTING=OFF
cmake --build ${build_dir} --target install
# # Cleanup (optional)
# rm -rf ${build_dir}
# Usage in downstream projects:
#
# In your downstream CMakeLists.txt:
#
# find_package(opensimcreator REQUIRED)
# # (other stuff)
# target_link_libraries(downstream_project PRIVATE opensimcreator) # link to it
#
# In your build script, depending on how/where you installed it:
#
# cmake -S downstream_project -B build_dir -DCMAKE_PREFIX_PATH=${install_dir}
# # (i.e. tell cmake where to find the install directory)
#
# In your C++:
#
# #include <libopensimcreator/SOME_HEADER_FROM_OPENSIMCRETOR>
# // see OpenSim Creator's source code for inspiration: you probably want to create
# // an `osc::OpenSimCreatorApp` and give it your own implementation of an `osc::Tab`
# // to show your own UI.
# //
# // e.g. as osc.cpp does for the `osc` top-level executable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment