Urho3D
Building Urho3D

Building prerequisites

Although all required third-party libraries are included as source code, there are system-level dependencies that must be satisfied before Urho3D can be built successfully:

To run Urho3D, the minimum system requirements are:

SSE requirement can be eliminated by commenting out lines that enable it from the root CMakeLists.txt.

Desktop build process

Urho3D uses CMake (http://www.cmake.org) to build. The process has two steps:

1) Run CMake in the root directory with your preferred toolchain specified to generate the build files. You can use the batch files or shell scripts provided: cmake_vs2008.bat, cmake_vs2010.bat or cmake_vs2012.bat on Windows, and cmake_gcc.sh on Linux and Mac OS X.

2) For Visual Studio, open Urho3D.sln and build the configuration(s) you like. For gcc, execute make (by default, cmake_gcc.sh specifies to make a RelWithDebInfo build.)

On Windows, using other compilers than Visual Studio is not officially supported. MinGW may work (cmake -G "MinGW Makefiles"), but may lack required DirectX headers. They can be copied to a MinGW installation from the following package: http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz

When using Xcode on Mac OS X, select the i386 architecture before building. Compiling Urho3D as 64-bit is not supported.

After the build is complete, the programs can be run from the Bin directory.

To run from the Visual Studio debugger, set the Urho3D project as the startup project and enter its relative path and filename into Properties -> Debugging -> Command: ..\Bin\Urho3D.exe. Additionally, entering -w into Debugging -> Command Arguments is highly recommended. This enables startup in windowed mode: without it running into an exception or breakpoint will be obnoxious as the mouse cursor will likely be hidden.

To actually make Urho3D.exe do something useful, it must be supplied with the name of the script file it should load and run. You can try for example the following arguments: Scripts/NinjaSnowWar.as -w

To make the Urho3D examples start faster on Windows & Direct3D9 mode, run CompileAllShaders.bat from the Bin directory first.

Android build process

First copy Bin/Data and Bin/CoreData directories to the Android/assets directory (you can use the provided batch file CopyData.bat.) Next, execute the following commands in the Android directory:

Note that ndk-build builds Urho3D twice, once without hardware floating point instructions, and once with them. After the commands finish successfully, the APK should have been generated to the Android/bin directory, from where it can be installed on a device or an emulator.

For a release build, use the "ant release" command instead of "ant debug" and follow the Android SDK instructions on how to sign your APK properly.

By default the Android package for Urho3D is com.googlecode.urho3d. For a real application you must replace this with your own package name. Unfortunately the name has to be replaced in several files:

iOS build process

Run cmake_ios.sh. This generates an Xcode project named Urho3D.xcodeproj.

Open the Xcode project and check the properties for the Urho3D project (topmost in the Project Navigator.) In Architectures -> Base SDK, choose your iOS SDK. In Code Signing, enter your developer identity as necessary.

The Urho3D target will actually build the application bundle and copy resources from Bin/Data and Bin/CoreData directories. Edit its build scheme to choose debug or release mode.

Note that due to a CMake / Xcode bug, you may need to modify and save Urho3D.cpp after modifying any of the libraries to get Xcode to re-link the executable. Do this also if you modify the data files and get an error about resources having been added or modified after signing.