![]() |
Cesium for Unreal 2.18.0
|
Detailed instructions for setting up a Cesium for Unreal development environment on macOS. Please see the Developer Setup page for an overview of the process.
These instructions are intended for Unreal Engine 5.4. The process is similar for newer versions of Unreal Engine. Supported Xcode versions are specified in /Users/Shared/Epic Games/UE_5.4/Engine/Config/Apple/Apple_SDK.json
.
The following illustrates the recommended directory layout for developers:
~/dev
- Your own root directory for development.~/dev/cesium-unreal-samples
- The directory for the Unreal project that will use the plugin.~/dev/cesium-unreal-samples/Plugins/cesium-unreal
- The directory for the actual Cesium for Unreal plugin.~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern/cesium-native
- The directory for the base libraries project.You may use any directory for the project, but the directory for the actual Cesium for Unreal plugin MUST be in a subdirectory Plugins/cesium-unreal
of the project directory. This way, Unreal will automatically find the Plugin when running the project, and pick up any changes that have been made to the plugin.
This can be set up with the following sequence of commands, on the console, starting in the ~/dev
directory:
cesium-native
submodule and its dependencies. If you forget the --recursive
option, you will see many compiler errors later in this process. If this happens to you, run the following in the Plugins\cesium-unreal
directory to update the submodules in the existing clone: The cesium-native libraries and their dependencies use CMake and must be built separately from Cesium for Unreal. Cesium for Unreal supports both Intel and Apple Silicon processors. In development, we usually just want to build for the host's architecture, which is done as follows:
(It may be helpful to place these commands in a shell script for future use.)
Or to build a Release version:
This will install the built libraries to one of these subdirectories of ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/
, depending on your configuration and processor architecture:
Darwin-arm64-Debug
- Debug configuration for Apple Silicon.Darwin-arm64-Release
- Release or RelWithDebInfo configuration for Apple Silicon.Darwin-x64-Debug
- Debug configuration for Intel processors.Darwin-x64-Release
- Release or RelWithDebInfo configuration for Intel processors.Cesium for Unreal expects to find the libraries in one of these locations, depending on its configuration:
Darwin-universal-Debug
- DebugGame configuration for both processors.Darwin-universal-Release
- Development and Shipping configuration for both processors.If we only care to run on the host's architecture, such as during development, we can create a symlink to enable the Cesium for Unreal build to find the libraries for the one processor:
Or, we can build for the other processor:
And then create universal libraries using lipo:
Note: It is recommended that the build steps for CMake command-line for macOS (above) be completed first. Unreal Engine Editor will not launch without the host side binaries compiled as well.
Configure the CMake project in the ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern
directory by following the instructions below. Use a different build directory than the one used for macOS as this will require compiling for a different architecture.
extern
directory, and not the cesium-native
subdirectory!Execute the following commands to build and install a Release version of cesium-native:
You can also build and install the debug version by using Debug
or RelWithDebInfo
instead of Release
.
The Cesium for Unreal plugin must be built as part of a larger project, and that project must be a C++ project. The Cesium for Unreal Samples project is a Blueprint project, not C++, but it's easy to convert it to a C++ project by copying the Source
directory from the documentation:
Now we can generate Xcode project files for the Samples project and the plugin:
You may see an error message like this:
Your Mac is set to use CommandLineTools for its build tools (/Library/Developer/CommandLineTools). Unreal expects Xcode as the build tools. Please install Xcode if it's not already, then do one of the following:
- Run Xcode, go to Settings, and in the Locations tab, choose your Xcode in Command Line Tools dropdown.
- In Terminal, run 'sudo xcode-select -s /Applications/Xcode.app' (or an alternate location if you installed Xcode to a non-standard location)
Either way, you will need to enter your Mac password.
In which case, do what it says.
If you see a message like this:
Exception while generating include data for UnrealEditor: Platform Mac is not a valid platform to build. Check that the SDK is installed properly.
It probably means Unreal doesn't like your Xcode version. Be sure that a supported version of Xcode is installed. Supported Xcode versions are specified in /Users/Shared/Epic Games/UE_5.4/Engine/Config/Apple/Apple_SDK.json
.
If the project file generation succeeds, you should see a file named CesiumForUnrealSamples (Mac).xcworkspace
in the same directory as your uproject. Double-click it to open Xcode.
In Xcode, on the Product -> Scheme menu, choose devEditor
. If you want to build a debug configuration, go to Product -> Scheme -> Edit Scheme -> Run, select the Info tab and then change the "Build Configuration" to "DebugGame".
Build by choosing Product -> Build. Watch the progress in the "Report Navigator" which is the rightmost icon above the tree on the left.
You can launch the Unreal Engine Editor and the Samples project with Product -> Run.
To get a call stack from a crash on an iOS device...
swift ~/github/AppleCrashScripts/convertFromJSON.swift -i dev-IOS-DebugGame-2025-02-06-204209.ips -o dev-IOS-DebugGame-2025-02-06-204209.crash
symbolicatecrash
, which comes with Xcode but is buried here /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/export PATH=$PATH:/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/
export DEVELOPER_DIR=$(xcode-select --print-path)
symbolicatecrash ./dev-IOS-DebugGame-2025-02-06-204209.crash