2. Setup Development Environment#
These are some generic tips that might be handy when setting up your own development environment.
2.1. Visual Studio 2022#
Run
python scripts/build_windows.py --skip-osc
(described above) to get a complete build of OSC’s dependencies.In Visual Studio 2020, open
opensim-creator
as a folder projectLater versions of Visual Studio (i.e. 2017+) should have in-built CMake support that automatically detects that the folder is a CMake project
- Right-click the
CMakeLists.txt
file to edit settings or build the project You may need to set your configure command arguments to point to the dependencies install (e.g.
-DCMAKE_PREFIX_PATH=$(projectDir)/osc-dependencies-install
)
- Right-click the
Use the
Switch between solutions and available views
button in theSolution Explorer
hierarchy tab to switch to theCMake Targets View
Right-click the
osc
CMake target andSet As Startup Project
, so that pressingF5
will then build+runosc.exe
(optional): switch the solution explorer view to a
Folder View
after doing this: the CMake view is crap for developing oscYou should now be able to build+run
osc
fromVisual Studio
To run tests, open the
Test Explorer
tab, which should list all of thegoogletest
tests in the project
2.2. QtCreator#
Run the appropriate (OS-dependent) buildscript (described above)
Open QtCreator and then open the
opensim-creator
source directory as a folderFor selecting a “kit”, QtCreator usually detects that
osc-build
already exists (side-effect of running the buildscript). You may need to “import existing kit/build” and then selectosc-build
, thoughOnce QtCreator knows your source dir (
opensim-creator/
) and build/kit (opensim-creator/osc-build
), it should be good to go