iOS (SFML_GRAPHICS backend)

Requirements

At least SFML 2.5 is required.

You must have already build SFML for iOS and verified that you can run your sfml app on your device or emulator. Only then should you proceed with installing TGUI.

You will need to use CMake in order to build TGUI. You can download the latest version here. After installing the GUI app, you will need to run the following from a terminal to make cmake usable from the terminal:

sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

The TGUI source code can be downloaded from the download page.

TGUI currently only supports building a static library for iOS, there is no option to build a dynamic library or framework.

CMake

For information about cross-compiling options for iOS with CMake that aren’t specific to TGUI, see CMake’s toolchains manual.

Execute something similar to the following in a terminal from within the TGUI folder:

cmake -S . -B build-ios
  -GXcode \
  -DCMAKE_SYSTEM_NAME=iOS \
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 \
  -DCMAKE_INSTALL_PREFIX=`pwd`/install-ios \
  -DTGUI_BACKEND=SFML_GRAPHICS
  -DFreeType_LIB=/Path/To/SFML/extlibs/libs-ios/libfreetype.a

Here is an explanation of each option:

If SFML can’t be found, you may need to add the -DSFML_DIR=... property with a directory that contains the SFMLConfig.cmake file (the path usually ends with lib/cmake/SFML/).

Building the library

The previous step will have created an Xcode project for building TGUI (if -GXcode was used). There are some issues/limitations when opening the project directly with Xcode, so it is best to build it with the following command:

cmake --build build-ios --config Release --target install

If all goes well, the newly created install-ios folder will contain a lib folder with the static tgui library in it (inside a Debug or Release subfolder if you used Xcode).

Using TGUI

Note that using TGUI in an iOS app has never actually been tested.

You should be able to just drag the tgui-s.a (or tgui-s-d.a) file into your project.