Building on Windows (Visual Studio or CMake) - ousnius/BodySlide-and-Outfit-Studio GitHub Wiki

Building BodySlide and Outfit Studio on Windows

This page is for developers building BodySlide and Outfit Studio from source on Windows. For Linux, see Building on Linux.

Recommended toolchain

The actively exercised Windows CI configuration currently uses:

  • Visual Studio 18 2026 on x64
  • CMake 3.16 or newer
  • vcpkg for third-party dependencies
  • Static runtime and static wxWidgets packages

Earlier MSVC versions may still work, but the configuration above is what the project currently builds and tests in CI.

Preferred: CMake + vcpkg

This is the easiest way to match the current Windows CI setup.

Prerequisites

  • Visual Studio with C++ desktop development tools installed
  • CMake 3.16 or newer
  • Git

Bootstrap vcpkg

git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat -disableMetrics

Install dependencies

Use the same packages as CI:

.\vcpkg\vcpkg.exe install wxwidgets[debug-support]:x64-windows-static catch2:x64-windows-static bullet3:x64-windows-static

With this setup you do not need to manually copy OpenGL headers into the Windows SDK.

Configure the project

From the repository root:

$toolchain = "C:\path\to\vcpkg\scripts\buildsystems\vcpkg.cmake"

cmake -S . -B build\windows-x64-relwithdebinfo `
  -G "Visual Studio 18 2026" `
  -A x64 `
  -DCMAKE_TOOLCHAIN_FILE="$toolchain" `
  -DVCPKG_TARGET_TRIPLET=x64-windows-static `
  -DBSOS_ENABLE_FBXSDK=OFF

Useful optional flags:

  • -DBSOS_BUILD_TESTS=ON to build the Catch2 test target
  • -DBSOS_ENABLE_FBXSDK=OFF to disable Autodesk FBX SDK integration explicitly
  • -DBSOS_ENABLE_BULLET=OFF to build without the physics preview

The project defaults to a static MSVC runtime when CMAKE_MSVC_RUNTIME_LIBRARY is not set.

Build

cmake --build build\windows-x64-relwithdebinfo --config RelWithDebInfo --target BodySlide OutfitStudio --parallel

If you enabled tests:

cmake --build build\windows-x64-relwithdebinfo --config RelWithDebInfo --target BSOSTests --parallel
ctest --test-dir build\windows-x64-relwithdebinfo -C RelWithDebInfo --output-on-failure

For a fuller overview of the BSOSTests target and optional fixture setup, see Running Tests.

Using Visual Studio after CMake configure

If you prefer the Visual Studio IDE, configure the project with CMake first and then open the generated solution from the build directory.

For example, after the configure step above, open the generated solution in:

build\windows-x64-relwithdebinfo\BSOS.slnx

You can then build BodySlide, OutfitStudio, and optionally BSOSTests from Visual Studio.

Alternative: existing wxWidgets installation

If you are not using vcpkg, CMake can also consume an existing wxWidgets build or installation.

Configure CMake with the wxWidgets root directory:

cmake -S . -B build\windows-x64-relwithdebinfo `
  -G "Visual Studio 18 2026" `
  -A x64 `
  -DwxWidgets_ROOT_DIR="C:\path\to\wxWidgets"

On Windows, the CMake project will automatically derive wxWidgets_LIB_DIR from wxWidgets_ROOT_DIR when needed.

If you maintain wxWidgets manually, make sure:

  • the compiler matches the one used for BodySlide and Outfit Studio
  • the architecture matches your target (x64 vs Win32)
  • the build configuration is compatible with the runtime you expect to use

vcpkg is still the preferred path because it avoids most manual wxWidgets and OpenGL setup issues.

FBX SDK support

FBX support is optional and only affects Outfit Studio's FBX import/export features.

Current CI builds disable it with -DBSOS_ENABLE_FBXSDK=OFF.

If you want FBX support locally, install the Autodesk FBX SDK and point CMake to it with one of these:

  • -DBSOS_FBXSDK_ROOT=C:\path\to\fbxsdk
  • -Dfbxsdk_dir=C:\path\to\fbxsdk
  • FBXSDK_ROOT environment variable

If the SDK is not found, disable FBX support explicitly and continue the build without it.

Bullet physics support

Bullet powers the physics preview in BodySlide and Outfit Studio, which simulates HDT-SMP physics XMLs referenced by the loaded meshes. It is optional: without Bullet both applications build normally, and their physics controls (the Bones tab in Outfit Studio, the preview panel in BodySlide) stay hidden.

The simulation itself is a port of the physics core of Faster HDT-SMP (GPL-3.0, the same license as this project), so the preview behaves like the game plugin. See src/physics/hdt/README.md in the repository for the port notes.

BSOS_ENABLE_BULLET defaults to ON, and CMake enables the feature when it finds Bullet. The configure output tells you which happened:

-- Bullet found: C:/path/to/include/bullet
-- Bullet not found; building without physics preview support

Installing bullet3 with vcpkg as shown above is enough; the vcpkg toolchain file makes CMake find it with no extra flags.

For a Bullet installation elsewhere, point CMake at it with either:

  • -DCMAKE_PREFIX_PATH="C:\path\to\bullet3\install"
  • -DBullet_DIR="C:\path\to\bullet3\install\lib\cmake\bullet"

CMake first looks for a Bullet config package (BulletConfig.cmake, provided by vcpkg and by Bullet's own install) and falls back to CMake's bundled FindBullet module.

Building Bullet from source

A source build is useful if you want a Bullet matching this project's static MSVC runtime without vcpkg. Install it beside the repository as bullet3\install, the same sibling-directory convention the wxWidgets and FBX SDK setups use, and both CMake and the hand-maintained OutfitStudio.vcxproj find it with no configuration at all:

git clone --depth 1 --branch 3.25 https://github.com/bulletphysics/bullet3.git
cd bullet3

cmake -S . -B build -A x64 `
  -DCMAKE_INSTALL_PREFIX="$PWD\install" `
  -DUSE_MSVC_RUNTIME_LIBRARY_DLL=OFF `
  -DINSTALL_LIBS=ON `
  -DBUILD_BULLET2_DEMOS=OFF -DBUILD_CPU_DEMOS=OFF -DBUILD_OPENGL3_DEMOS=OFF `
  -DBUILD_EXTRAS=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_PYBULLET=OFF

cmake --build build --config Release --target INSTALL --parallel
cmake --build build --config Debug --target INSTALL --parallel

Notes:

  • USE_MSVC_RUNTIME_LIBRARY_DLL=OFF matches the static runtime this project uses. A mismatch here shows up as linker errors about conflicting runtime libraries.
  • Installing both configurations is only needed if you want to build in Debug. Bullet installs its debug libraries with a _Debug suffix next to the release ones, and the project picks the right variant per configuration automatically.
  • Bullet 3.25 declares a minimum CMake version that CMake 4.x rejects. If configuring fails with a message about cmake_minimum_required, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5.
  • Build Bullet in a short path. MSBuild can fail with path-length errors when the build directory is nested deeply.

Build outputs and local packaging

At minimum, a usable local build needs:

  • BodySlide.exe
  • OutfitStudio.exe
  • res\
  • lang\

For packaged builds, also include the XML/config files that ship with the app, such as:

  • BodySlide.xml
  • BuildSelection.xml
  • Config.xml
  • OutfitStudio.xml
  • RefTemplates.xml

The Windows CI package also creates empty content folders such as SliderSets, Automations, PoseData, RefTemplates, ShapeData, SliderCategories, SliderGroups, and SliderPresets.

Troubleshooting

CMake cannot find wxWidgets

Use the vcpkg toolchain file, or provide wxWidgets_ROOT_DIR when using a manual installation.

CMake cannot find the FBX SDK

Either point CMake at the SDK with BSOS_FBXSDK_ROOT or disable FBX support with -DBSOS_ENABLE_FBXSDK=OFF.

CMake cannot find Bullet

Install bullet3 for the same triplet as the rest of the build, or point CMake at an existing installation with CMAKE_PREFIX_PATH or Bullet_DIR. This is never fatal: the build continues without the physics preview.

Tests fail to configure on Windows

Make sure Catch2 is installed for the same triplet as the rest of the build, for example x64-windows-static when following the CI-style setup.