SDK Build Environment using Microsoft MSBuild - magic-lantern-studio/mle-documentation GitHub Wiki
This page discusses how to build the Magic Lantern SDK for Microsoft Win32 platforms using MSBuild. Instructions for building the Magic Lantern SDK for Microsoft platforms using Visual Studio can be found at SDK Build Environment using Microsoft Visual Studio.
Table of Contents
Dependencies
This section identifies dependencies for building the Magic Lantern SDK.
- Version 3.10.11 of Python is installed.
- Instructions assume that the installation directory is the default location chosen by the installer. The PYTHON_HOME environment variable will need to be set to indicate this location.
- Python is required by the mastering process to create a Digital Playprint.
- Instructions can be found at Python-Development-Environment for Windows platform.
- Microsoft Visual Studio 2022 is installed. Note that the following VS IDEs are no longer being supported:
- Microsoft Visual Studio C++ v6.0 (deprecated)
- Microsoft Visual Studio C++ 2005 (deprecated)
- Microsoft Visual Studio C++ 2010 (deprecated)
- Microsoft Visual Studio C++ 2017 (deprecated)
- Version 4.0.0 of Coin is built and installed.
- Instructions assume that the installation directory is M:\Coin3D. The COINDIR environment variable will need to be set to indicate this location.
- Coin is an implementation of the SGI Inventor framework. It is required by the Magic Lantern Rehearsal Player.
- The most recent version can be found at https://github.com/magic-lantern-studio/coin .
- Instructions to build the source can be found at https://github.com/magic-lantern-studio/coin/wiki/Coin-4.0.0-Build-Instructions-for-Windows.
- Version 1.6.0 of SoWin is built and installed.
- Instructions assume that the installation directory is M:\Coin3D.
- The most recent version can be found at https://github.com/magic-lantern-studio/sowin .
- Instructions to build the source can be found at https://github.com/magic-lantern-studio/mle-documentation/wiki/SoWin-Build-Instructions-for-Windows.
- Version 3.18.0 of FreeImage
- Instructions assume that the installation directory is M:\FreeImage. The FREEIMAGEDIR environment variable will need to be set to indicate this location.
- The most recent version can be found at https://github.com/magic-lantern-studio/freeimage.
- Magic Lantern build instructions are documented on FreeImage Build Instructions.
Assumptions
These instructions assume the following
- The dependencies above are installed under a Windows drive labeled "M" (e.g. M:). You can use the Microsoft Command, subst, to point "M:" to a file directory that will be the root of the Magic Lantern build environment. For example, "subst M: F:/" will cause M: to reference the F drive. Or, "subst M: C:\Users\msm" will cause M: to reference the "Users\msm" directory on the C drive.
[!Note] Use "subst M: /D to unmap the drive.
- The Magic Lantern software has been downloaded into the "M:\Projects\MagicLantern" directory and the MLE_HOME environment variable is set to "M:\Projects\MagicLantern".
- You already know how to use Microsoft Visual Studio 2022 (Microsoft Visual Studio C++ v6.0, 2005, 2010 and 2017 are no longer supported).
Environment Variables
MLE_HOME Environment Variable
Set the variable MLE_HOME to reference the home of the Magic Lantern source. This document assumes that it is set to "M:\projects\MagicLantern".
MLE_ROOT Environment Variable
Set the variable MLE_ROOT to reference the root directory where the Magic Lantern components will be installed. This document assumes that it is set to "M:/projects/MagicLantern".
[!Note] This variable uses the UNIX-style path delimiter ('/').
MLE_WORKPRINTS Environment Variable
Set the variable MLE_WORKPRINTS to the root directory where Magic Lantern Digital Workprints can be located. This document assumes that it is set to //M/projects/MagicLantern/include.
The Magic Lantern Studio assumes that the Digital Workprints will be located under the $MLE_WORKPRINTS/workprints directory.
[!Note] This variable uses a canonical path style for the drive (i.e. //M/).
MLEDEV_CORE Environment Variable (Optional)
Set the MLEDEV_CORE variable to the development directory where the Core library source is. This value will most likely be $MLE_HOME\Core.
MLEDEV_DWP Environment Variable (Optional)
Set the MLEDEV_DWP variable to the development directory where the Digital Workprint library source is. This value will most likely be $MLE_HOME\DigitalWorkprint.
MLEDEV_DPP Environment Variable (Optional)
Set the MLEDEV_DPP variable to the development directory where the Digital Playprint library source is. This value will most likely be $MLE_HOME\DigitalPlayprint.
PYTHON_HOME Environment Variable
Set the PYTHON_HOME variable to the installation directory for Python. For these instructions, use M:\Python.
COINDIR Environment Variable
Set the COINDIR variable to the installation directory for Coin3D. For these instructions, use M:\Coin3D.
FREEIMAGEDIR Environment Variable
Set the FREEIMAGEDIR variable to the installation directory for FreeImage. For these instructions, use M:\FreeImage\Dist.
BRENDER_PATH Environment Variable (Ignore)
Set the BRENDER_PATH variable to the installation directory for BRender. For these instructions, use M:\BRENDER\V1_2_1\DAT.
[!Note] The BRender target is Obsolete and only available on a 32-bit platform.
PATH Environment Variable
Make sure the following paths are part of the PATH environment variable.
- M:\projects\MagicLantern\bin
- M:\projects\MagicLantern\bin\rehearsal
- M:\Coin3d\bin
- M:\Python\bin
Details
To build the Magic Lantern components using Microsoft Visual Studio 2022 MSBuild, use the following instructions. Note that the Microsoft Visual Studio C++ v6.0, 2005, 2010 and 2017 instructions may no longer work, but are provided here for historical perspective.
64-bit builds are staged in the "bin64" and "lib64" directories under $MLE_ROOT. The tables below only specify the 64-bit build results.
[!Note] The build artifacts for the 32-bit platform would be installed in the "bin" and "lib" directories under $MLE_ROOT. However, targets for the 32-bit platform have been removed from build.msvc17.proj.
Download Source
The source for the Magic Lantern projects is hosted at Github on the magic-lantern-studio Organization. The repositories are set up to use SSH.
The best way to utilize git on Windows platforms is to install the "Git for Windows" toolchain. Then use the Github instructions at Generating a new SSH key and adding it to the ssh-agent to manage your SSH key.
The Magic Lantern Studio git repositories are comprised of:
- mle-core-env - Core environment utilities
- mle-core-util - Core utility library
- mle-core-math - Core math library
- mle-core-dwp - Core Digital Workprint library and tools
- mle-core-dpp - Core Digital Playprint library and tools
- mle-core-mlert - Core Magic Lantern Runtime library
- mle-parts - Magic Lantern parts (Actor/Role/MediaRef/Set/Stage)
- mle-atk - Authoring tool kit
- mle-players - Magic Lantern players (Rehearsal Player)
- mle-studio - Studio components for IDEs (Eclipse)
- mle-titles - Example Magic Lantern titles and applications
- mle-documentation - Documentation
To download the source, do the following
$ mkdir Github-MagicLanternStudio
$ cd Github-MagicLanternStudio
$ git clone [email protected]:magic-lantern-studio/mle-core-env.git
$ git clone [email protected]:magic-lantern-studio/mle-core-util.git
$ git clone [email protected]:magic-lantern-studio/mle-core-math.git
$ git clone [email protected]:magic-lantern-studio/mle-core-dwp.git
$ git clone [email protected]:magic-lantern-studio/mle-core-dpp.git
$ git clone [email protected]:magic-lantern-studio/mle-core-mlert.git
$ git clone [email protected]:magic-lantern-studio/mle-parts.git
$ git clone [email protected]:magic-lantern-studio/mle-atk.git
$ git clone [email protected]:magic-lantern-studio/mle-players.git
$ git clone [email protected]:magic-lantern-studio/mle-studio.git
$ git clone [email protected]:magic-lantern-studio/mle-titles.git
$ git clone [email protected]:magic-lantern-studio/mle-documentation.git
64-bit Platform Target
To build the SDK for a 64-bit platform, do the following:
- Run the Visual Studio Command Prompt (x64 Native Tools Command Prompt for VS 2022) tool.
- In the command window, cd %MLE_HOME%\build\win32 directory.
- Run "msbuild build.msvc17.proj /t:BuildSDK64"
- Run "msbuild build.msvc17.proj /t:BuildRehearsal64"
See Microsoft MSBuild 64-bit Targets for more information concerning available build targets.
32-bit Platform Target (Deprecated)
To build the SDK for a 32-bit platform, do the following:
- Run the Visual Studio Command Prompt (x86 Native Tools Command Prompt for VS 2017) tool.
- In the command window, cd %MLE_HOME%\build\win32 directory.
- Run "msbuild build.msvc15.proj /t:BuildSDK32"
- Run "msbuild build.msvc15.proj /t:BuildRehearsal32"
See Microsoft MSBuild 32-bit Targets for more information concerning available build targets.