Jump to: navigation, search

User:Legoboyvdlp/Building using CMake - Windows

1,847 bytes added, 16:19, 20 October 2020
Scripted Compilation
=== Scripted Compilation ===
These scripts This script will allow you to build SimGear and FlightGear automatically. {{collapsible script| type = Windows batch file| title = The <code>build.bat</code> script for configuring and compiling OSG, SG, and FG| lang = batch| script = REM Configure.SET PATH=%PATH%;%ProgramFiles%\CMake\binSET QT5SDK64=C:\Qt\5.15.0\msvc2019_64SET CMAKE_TOOLCHAIN="Visual Studio 16 2019"SET ROOT_DIR=C:\Users\redpa\Documents\FlightGear\fg-from-scratch\FlightGearBuild
==== Postmd osg-installation ====buildmd simgear-buildmd flightgear-build
cd %ROOT_DIR%\osg-build cmake %ROOT_DIR%\osg -G %CMAKE_TOOLCHAIN% -A x64 ^ -DACTUAL_3RDPARTY_DIR=%ROOT_DIR%\windows-3rd-party/msvc140/3rdParty.x64 ^ -DCMAKE_RELWITHDEBINFO_POSTFIX:STRING= ^ -DOSG_USE_UTF8_FILENAME:BOOL=ON ^ -DWIN32_USE_MP:BOOL=ON ^ -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\installcmake --build . --config RelWithDebInfo --target INSTALL cd %ROOT_DIR%\simgear-buildcmake %ROOT_DIR%\simgear -G %CMAKE_TOOLCHAIN% -A x64 ^ -DMSVC_3RDPARTY_ROOT=%ROOT_DIR%\windows-3rd-party\msvc140 ^ -DOSG_FSTREAM_EXPORT_FIXED:BOOL=ON ^ -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\installcmake --build . --config RelWithDebInfo --target INSTALL cd %ROOT_DIR%\flightgear-buildcmake %ROOT_DIR%\flightgear -G %CMAKE_TOOLCHAIN% -A x64 ^ -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install ^ -DCMAKE_PREFIX_PATH=%QT5SDK64% ^ -DOSG_FSTREAM_EXPORT_FIXED:BOOL=ON ^ -DENABLE_COMPOSITOR:BOOL=OFF cmake --build . --config RelWithDebInfo --target INSTALL| show = 1}} Before starting to use the script, you need to:1. Set the path to CMAKE2. Set the path to the QT5 SDK3. Set your toolchain, e.g. "Visual Studio 16 2019"4. Set ROOT_DIR to the FlightgearBuild folder you created (the above directory structure) ==== Post-compilation ==== Open flightgear-build/FlightGear.sln. You can then perform all your development / debugging directly in VS. You normally only need to run build.bat again, if you update SimGear or OSG.
To launch FlightGear from Visual Studio, you can

Navigation menu