SDK Build Environment for the MacOS Platform - magic-lantern-studio/mle-documentation GitHub Wiki

This page discusses how to build the Magic Lantern SDK for MacOS platforms using the C++ implementation. Two build environments are being supported:

  1. Qt Creator Project
  2. Apple Xcode Project

Table of Contents

Dependencies

The MacOS build of the Magic Lantern SDK has the following dependencies:

Qt Build Dependencies

In addition to the above dependencies, the following tools and SDK are required if you choose to build using the Qt platform.

  • Qt Creator
  • Qt 5.15.x Development Kit

Install Qt Tools

Use this page to install the Qt5.x Build Environment.

Install repo

Install Google Repo command using homebrew.

brew install repo

By default, repo will be installed in /opt/homebrew/bin/repo

Assumptions

These instructions assume the following

  • You already know how to use the MacOS platform.
  • You already know how to install packages in MacOS using Homebrew.
  • You already know how to use the Apple Xcode IDE and command-line tools.
  • You already know how to us the Qt Creator IDE.
  • You already know how to use Git.
  • The Magic Lantern software has been downloaded into the "~/Projects/MagicLantern" directory and the MLE_HOME environment variable is set to "~/Projects/MagicLantern".

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 "$HOME/Projects/MagicLanternStudio".

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 "/opt/MagicLantern".

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 $HOME/Projects/MagicLanternStudio.

The Magic Lantern Studio assumes that the Digital Workprints will be located under the $MLE_WORKPRINTS/workprints directory.

Details

Retrieve the Source

Using the Google 'repo' command, retrieve the Magic Lantern source:

$ mkdir Github-MagicLantern
$ cd Github-MagicLantern
$ repo init -u [email protected]:magic-lantern-studio/mle-manifests
$ repo sync

After the source code has been retrieved, it is necessary to stage the $MLE_HOME directory. To do this, links will be created from the MLE_HOME directory to the downloaded source located in Github-MagicLantern. Run the following script in the Github-MagicLantern directory:

$ ./mle-core-env/bin/scripts/stagemle.sh

Qt Creator Projects

To build the Magic Lantern components using the Qt CtCreator C/C++ toolchain, use the following instructions.

TBD

Xcode Projects

The following Xcode projects are available for building the Magic Lantern SDK.

Build the Core util Library for Tools

These instructions build the Core util libraries for the Magic Lantern Studio tools using the Apple Xcode IDE.

  • Xcode Project: "$MLE_HOME/Core/util/mac/build/mlutil/mlutil.xcodeproj"

Import the above Xcode project by selecting "File->Open...". This will bring up a Open dialog where you can navigate to the above mlutil.xcodeproj file. After selecting this project file, choose the Open button.

In the Xcode drop-down menu, select "Product->Build" to build the libmlutil.dylib dynamic library. If successful, the library and public header files will be installed in $MLE_ROOT.

The library components that are built include

Library Directory Location Component
libmlutil.dylib "$MLE_ROOT/lib" Magic Lantern SDK (Debug)

where MLE_ROOT is currently /opt/MagicLantern.

Build the Core math Libraries

These instructions build the Core math libraries for the Magic Lantern Studio tools and SDK.

  • Xcode Project: "$MLE_HOME/Core/math/mac/mlmath.xcodeproj"

Import the above Xcode project by selecting "File->Open...". This will bring up a Open dialog where you can navigate to the above mlmath.xcodeproj file. After selecting this project file, choose the Open button.

In the Xcode drop-down menu, select "Product->Build" to build the libmlmath.dylib dynamic library. If successful, the library and public header files will be installed in $MLE_ROOT.

The library components that are built include

Library Directory Location Component
libmlmath.dylib "$MLE_ROOT/lib" Magic Lantern SDK (Debug)

where MLE_ROOT is currently /opt/MagicLantern.