Building using CMake - Windows: Difference between revisions

Jump to navigation Jump to search
→‎Script compilation: Added the compilation and clean up batch files.
(→‎Building: Shifted the build instructions into the subsection 'GUI compilation' and created a 'Script compilation' subsection to document another way of building.)
(→‎Script compilation: Added the compilation and clean up batch files.)
Line 88: Line 88:


=== Script compilation ===
=== Script compilation ===
Firstly set up the directory structure as above.  For the following scripts, the Windows environmental variable <code>MSVC_3RDPARTY_ROOT</code> must be set to the full path where this is located.
==== SimGear ====
For building SimGear with MSVC 2015 as 64-bit:
{{collapsible script
| type  = Windows batch file
| title  = The <code>.cmake.bat</code> script for configuring and compiling SimGear
| lang  = batch
| script = REM Configure.
cmake .. ^
-DMSVC_3RDPARTY_ROOT=%MSVC_3RDPARTY_ROOT% ^
-DCMAKE_INSTALL_PREFIX=%MSVC_3RDPARTY_ROOT%\install\msvc140-64\SimGear ^
-G"Visual Studio 14 Win64"
REM Compile.
cmake --build . --target install
}}
{{collapsible script
| type  = Windows batch file
| title  = The <code>.cmake.bat</code> script for configuring and compiling SimGear (with debugging symbols)
| lang  = batch
| script = REM Configure.
cmake .. ^
-DMSVC_3RDPARTY_ROOT=%MSVC_3RDPARTY_ROOT% ^
-DCMAKE_INSTALL_PREFIX=%MSVC_3RDPARTY_ROOT%\install\msvc140-64\SimGear ^
-G"Visual Studio 14 Win64"
REM Compile.
cmake --build . --config RelWithDebInfo --target install
}}
Place the script in a new directory within the SimGear sources such as <code>build</code>.  To clean up the build files, another batch file can be used:
{{collapsible script
| type  = Windows batch file
| title  = The <code>.clean.bat</code> script for cleaning up the build
| lang  = batch
| script = @echo off
rm -rf [0-9A-Za-z]* .vs
}}
==== FlightGear ====
For building FlightGear with MSVC 2015 as 64-bit:
{{collapsible script
| type  = Windows batch file
| title  = The <code>.cmake.bat</code> script for configuring and compiling FlightGear
| lang  = batch
| script = REM Configure.
cmake .. ^
-DMSVC_3RDPARTY_ROOT=%MSVC_3RDPARTY_ROOT% ^
-DCMAKE_INSTALL_PREFIX=%MSVC_3RDPARTY_ROOT%\install\msvc140-64\FlightGear ^
-DCMAKE_PREFIX_PATH=D:\Qt\Qt5.6.2\5.6\msvc2015_64\ ^
-G"Visual Studio 14 Win64"
REM Compile.
cmake --build . --target install
}}
{{collapsible script
| type  = Windows batch file
| title  = The <code>.cmake.bat</code> script for configuring and compiling FlightGear (with debugging symbols)
| lang  = batch
| script = REM Configure.
cmake .. ^
-DMSVC_3RDPARTY_ROOT=%MSVC_3RDPARTY_ROOT% ^
-DCMAKE_INSTALL_PREFIX=%MSVC_3RDPARTY_ROOT%\install\msvc140-64\FlightGear ^
-DCMAKE_PREFIX_PATH=D:\Qt\Qt5.6.2\5.6\msvc2015_64\ ^
-G"Visual Studio 14 Win64"
REM Compile.
cmake --build . --config RelWithDebInfo --target install
}}
Place the script in a new directory within the FlightGear sources such as <code>build</code>.  Note: change the <code>CMAKE_PREFIX_PATH</code> variable to your Qt installation directory.  To clean up the build files, another batch file can be used:
{{collapsible script
| type  = Windows batch file
| title  = The <code>.clean.bat</code> script for cleaning up the build
| lang  = batch
| script = @echo off
rm -rf [0-9A-Za-z]* .vs
}}


=== Updating ===
=== Updating ===

Navigation menu