Hi,
Seeing a lot of questions pertaining to how to develop Orbiter using Visual Studio 2019, I've decided to share the setup I use
Steps:


Optional:


By default, Visual Studio will try to build Orbiter in x64-Debug configuration.
Navigate to "Edit JSON file" in CMake Settings, then paste the contents of attached CMakeSettings.json file there. Replace G:\\Games\\Orbiter\\Textures with path to your Orbiter installation (don't forget the double slashes). After you do so, you'll see an expanded set of configurations to choose from:


This step may happen automatically depending on your VS settings (you'll see some cmake logs in "Output" window)


Paste below JSON into opened launch.vs.json file:
This will set up the working directory correctly, so Orbiter.exe can find all the modules and scenarios despite being placed in a subdirectory
Congratulations! You have a working setup to build Orbiter
Seeing a lot of questions pertaining to how to develop Orbiter using Visual Studio 2019, I've decided to share the setup I use
Steps:
1.Install latest version of Visual Studio 2019
Required components:- "Desktop Development with C++" package
- "MFC for latest build tools" component under "Individual Components"


Optional:
- Install "Git for Windows" from here to skip next step
2.Install Git for Windows
Self-explanatory. Link to official download: https://git-scm.com/download/win3.Clone Orbiter repository
Bash:
cd %userprofile%
git clone https://github.com/orbitersim/orbiter.git
4.Open Orbiter directory in Visual Studio
Make sure to use "Open a local folder" and not "Open a project or solution"
5.Set up "CMake Settings"

By default, Visual Studio will try to build Orbiter in x64-Debug configuration.
- to create other configurations, go to "CMake Settings for Orbiter", or use the template from step 6
- it is recommended to point ORBITER_PLANET_TEXTURE_INSTALL_DIR variable to Textures directory of an existing Orbiter 2016 installation
6.Optional: Paste CMakeSettings.json
Navigate to "Edit JSON file" in CMake Settings, then paste the contents of attached CMakeSettings.json file there. Replace G:\\Games\\Orbiter\\Textures with path to your Orbiter installation (don't forget the double slashes). After you do so, you'll see an expanded set of configurations to choose from:
7.Configure

This step may happen automatically depending on your VS settings (you'll see some cmake logs in "Output" window)
8.Build

9.Set up launch settings for Orbiter_NG version
Select "Orbiter.exe (Modules\\Server\\Orbiter.exe)" in launch target dropdown. Go to "Debug"=>"Debug and Launch settings for Orbiter_server".
Paste below JSON into opened launch.vs.json file:
JSON:
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"currentDir": "out/build/${cmake.name}",
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "Orbiter.exe (Modules\\Server\\Orbiter.exe)",
"name": "Orbiter.exe (Modules\\Server\\Orbiter.exe)"
}
]
}
Congratulations! You have a working setup to build Orbiter
Attachments
Last edited: